From 1fbbb997e9e69a11470287bcdaca083935db2faa Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 17 Dec 2025 21:07:06 +0000 Subject: [PATCH 1/2] feat: add POSTGRES_18 to DatabaseVersion PiperOrigin-RevId: 845801340 Source-Link: https://github.com/googleapis/googleapis/commit/59fdfa7adad87f1698f2351591d8379a230041af Source-Link: https://github.com/googleapis/googleapis-gen/commit/3cc2f58eec43885fa9da687a62ffe9def0040fbb Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWFsbG95X2RiLXYxYmV0YS8uT3dsQm90LnlhbWwiLCJoIjoiM2NjMmY1OGVlYzQzODg1ZmE5ZGE2ODdhNjJmZmU5ZGVmMDA0MGZiYiJ9 --- .../google-cloud-alloy_db-v1beta/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-alloy_db-v1beta/.rubocop.yml | 33 + .../google-cloud-alloy_db-v1beta/.toys.rb | 28 + .../google-cloud-alloy_db-v1beta/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-alloy_db-v1beta/CHANGELOG.md | 2 + .../google-cloud-alloy_db-v1beta/Gemfile | 11 + .../google-cloud-alloy_db-v1beta/LICENSE.md | 201 + .../google-cloud-alloy_db-v1beta/README.md | 154 + .../google-cloud-alloy_db-v1beta/Rakefile | 169 + .../gapic_metadata.json | 222 + .../google-cloud-alloy_db-v1beta.gemspec | 30 + .../lib/google-cloud-alloy_db-v1beta.rb | 21 + .../lib/google/cloud/alloy_db/v1beta.rb | 46 + .../cloud/alloy_db/v1beta/alloy_db_admin.rb | 56 + .../alloy_db/v1beta/alloy_db_admin/client.rb | 4929 +++++++++++++++++ .../v1beta/alloy_db_admin/credentials.rb | 47 + .../v1beta/alloy_db_admin/operations.rb | 841 +++ .../alloy_db/v1beta/alloy_db_admin/paths.rb | 231 + .../alloy_db/v1beta/alloy_db_admin/rest.rb | 54 + .../v1beta/alloy_db_admin/rest/client.rb | 4628 ++++++++++++++++ .../v1beta/alloy_db_admin/rest/operations.rb | 924 +++ .../alloy_db_admin/rest/service_stub.rb | 2422 ++++++++ .../v1beta/alloy_db_cloud_sql_admin.rb | 56 + .../v1beta/alloy_db_cloud_sql_admin/client.rb | 536 ++ .../alloy_db_cloud_sql_admin/credentials.rb | 47 + .../alloy_db_cloud_sql_admin/operations.rb | 841 +++ .../v1beta/alloy_db_cloud_sql_admin/paths.rb | 149 + .../v1beta/alloy_db_cloud_sql_admin/rest.rb | 54 + .../alloy_db_cloud_sql_admin/rest/client.rb | 494 ++ .../rest/operations.rb | 924 +++ .../rest/service_stub.rb | 143 + .../alloy_db/v1beta/bindings_override.rb | 75 + .../lib/google/cloud/alloy_db/v1beta/rest.rb | 39 + .../google/cloud/alloy_db/v1beta/version.rb | 28 + .../cloud/alloydb/v1beta/csql_resources_pb.rb | 44 + .../cloud/alloydb/v1beta/csql_service_pb.rb | 53 + .../v1beta/csql_service_services_pb.rb | 45 + .../cloud/alloydb/v1beta/data_model_pb.rb | 45 + .../google/cloud/alloydb/v1beta/gemini_pb.rb | 47 + .../cloud/alloydb/v1beta/resources_pb.rb | 125 + .../google/cloud/alloydb/v1beta/service_pb.rb | 136 + .../alloydb/v1beta/service_services_pb.rb | 147 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/alloydb/v1beta/csql_resources.rb | 42 + .../cloud/alloydb/v1beta/csql_service.rb | 45 + .../google/cloud/alloydb/v1beta/data_model.rb | 75 + .../google/cloud/alloydb/v1beta/gemini.rb | 67 + .../google/cloud/alloydb/v1beta/resources.rb | 1801 ++++++ .../google/cloud/alloydb/v1beta/service.rb | 1871 +++++++ .../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 | 121 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/date.rb | 53 + .../proto_docs/google/type/dayofweek.rb | 49 + .../proto_docs/google/type/expr.rb | 75 + .../proto_docs/google/type/timeofday.rb | 45 + .../snippets/Gemfile | 32 + .../alloy_db_admin/batch_create_instances.rb | 54 + .../snippets/alloy_db_admin/create_backup.rb | 54 + .../snippets/alloy_db_admin/create_cluster.rb | 54 + .../alloy_db_admin/create_database.rb | 47 + .../alloy_db_admin/create_instance.rb | 54 + .../create_secondary_cluster.rb | 54 + .../create_secondary_instance.rb | 54 + .../snippets/alloy_db_admin/create_user.rb | 47 + .../snippets/alloy_db_admin/delete_backup.rb | 54 + .../snippets/alloy_db_admin/delete_cluster.rb | 54 + .../alloy_db_admin/delete_instance.rb | 54 + .../snippets/alloy_db_admin/delete_user.rb | 47 + .../snippets/alloy_db_admin/execute_sql.rb | 47 + .../snippets/alloy_db_admin/export_cluster.rb | 54 + .../alloy_db_admin/failover_instance.rb | 54 + .../generate_client_certificate.rb | 47 + .../snippets/alloy_db_admin/get_backup.rb | 47 + .../snippets/alloy_db_admin/get_cluster.rb | 47 + .../alloy_db_admin/get_connection_info.rb | 47 + .../snippets/alloy_db_admin/get_instance.rb | 47 + .../snippets/alloy_db_admin/get_user.rb | 47 + .../snippets/alloy_db_admin/import_cluster.rb | 54 + .../snippets/alloy_db_admin/inject_fault.rb | 54 + .../snippets/alloy_db_admin/list_backups.rb | 51 + .../snippets/alloy_db_admin/list_clusters.rb | 51 + .../snippets/alloy_db_admin/list_databases.rb | 51 + .../snippets/alloy_db_admin/list_instances.rb | 51 + .../list_supported_database_flags.rb | 51 + .../snippets/alloy_db_admin/list_users.rb | 51 + .../alloy_db_admin/promote_cluster.rb | 54 + .../alloy_db_admin/restart_instance.rb | 54 + .../alloy_db_admin/restore_cluster.rb | 54 + .../alloy_db_admin/switchover_cluster.rb | 54 + .../snippets/alloy_db_admin/update_backup.rb | 54 + .../snippets/alloy_db_admin/update_cluster.rb | 54 + .../alloy_db_admin/update_instance.rb | 54 + .../snippets/alloy_db_admin/update_user.rb | 47 + .../alloy_db_admin/upgrade_cluster.rb | 54 + .../restore_from_cloud_sql.rb | 54 + ..._metadata_google.cloud.alloydb.v1beta.json | 1575 ++++++ .../v1beta/alloy_db_admin_operations_test.rb | 400 ++ .../v1beta/alloy_db_admin_paths_test.rb | 163 + .../v1beta/alloy_db_admin_rest_test.rb | 2271 ++++++++ .../alloy_db/v1beta/alloy_db_admin_test.rb | 2702 +++++++++ ...lloy_db_cloud_sql_admin_operations_test.rb | 400 ++ .../alloy_db_cloud_sql_admin_paths_test.rb | 115 + .../alloy_db_cloud_sql_admin_rest_test.rb | 156 + .../v1beta/alloy_db_cloud_sql_admin_test.rb | 188 + .../test/helper.rb | 25 + 118 files changed, 35353 insertions(+) create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.gitignore create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.toys.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.yardopts create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/Gemfile create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/README.md create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/Rakefile create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/google-cloud-alloy_db-v1beta.gemspec create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google-cloud-alloy_db-v1beta.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/rest.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/version.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/data_model_pb.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/gemini_pb.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_service.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/data_model.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/gemini.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/service.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/date.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/dayofweek.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/timeofday.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/batch_create_instances.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_backup.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_database.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_instance.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_instance.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_user.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_backup.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_instance.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_user.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/execute_sql.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/export_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/failover_instance.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/generate_client_certificate.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_backup.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_connection_info.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_instance.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_user.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/import_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/inject_fault.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_backups.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_clusters.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_databases.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_instances.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_supported_database_flags.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_users.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/promote_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restart_instance.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restore_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/switchover_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_backup.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_instance.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_user.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/upgrade_cluster.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/snippet_metadata_google.cloud.alloydb.v1beta.json create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_test.rb create mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/helper.rb diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/.gitignore b/owl-bot-staging/google-cloud-alloy_db-v1beta/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/.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-alloy_db-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-alloy_db-v1beta/.repo-metadata.json new file mode 100644 index 000000000000..fa2c90a7068f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "alloydb.googleapis.com", + "api_shortname": "alloydb", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-alloy_db-v1beta/latest", + "distribution_name": "google-cloud-alloy_db-v1beta", + "is_cloud": true, + "language": "ruby", + "name": "alloydb", + "name_pretty": "AlloyDB V1BETA API", + "product_documentation": "https://cloud.google.com/alloydb/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. Note that google-cloud-alloy_db-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-alloy_db instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/alloydb/docs", + "ruby-cloud-service-override": "AlloyDBCSQLAdmin=AlloyDBCloudSQLAdmin", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-alloy_db-v1beta/.rubocop.yml new file mode 100644 index 000000000000..5990f34b62b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-alloy_db-v1beta.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-alloy_db-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/.toys.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/.toys.rb new file mode 100644 index 000000000000..9a210f1427c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +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-alloy_db-v1beta/.yardopts b/owl-bot-staging/google-cloud-alloy_db-v1beta/.yardopts new file mode 100644 index 000000000000..3b974a03f407 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="AlloyDB V1BETA 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-alloy_db-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-alloy_db-v1beta/AUTHENTICATION.md new file mode 100644 index 000000000000..8cd16e98873b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-alloy_db-v1beta 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-alloy_db-v1beta 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/alloy_db/v1beta" + +client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/alloy_db/v1beta" + +::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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-alloy_db-v1beta +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/alloy_db/v1beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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-alloy_db-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-alloy_db-v1beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/Gemfile b/owl-bot-staging/google-cloud-alloy_db-v1beta/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-alloy_db-v1beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/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-alloy_db-v1beta/README.md b/owl-bot-staging/google-cloud-alloy_db-v1beta/README.md new file mode 100644 index 000000000000..45aa9fde926f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the AlloyDB V1BETA API + +AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. + +AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the AlloyDB V1BETA API. Most users should consider using +the main client gem, +[google-cloud-alloy_db](https://rubygems.org/gems/google-cloud-alloy_db). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-alloy_db-v1beta +``` + +## 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/alloydb.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/alloy_db/v1beta" + +client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new +request = ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.new # (request fields as keyword arguments...) +response = client.list_clusters request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-alloy_db-v1beta/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/alloydb/docs) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/alloy_db/v1beta" +require "logger" + +client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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-alloy_db`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-alloy_db-v1beta`. +_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-alloy_db`. +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-alloy_db-v1beta`. + +### 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-alloy_db-v1beta/Rakefile b/owl-bot-staging/google-cloud-alloy_db-v1beta/Rakefile new file mode 100644 index 000000000000..bcbdda50d8bc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +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-alloy_db-v1beta 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/alloy_db/v1beta/alloy_db_admin/credentials" + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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-alloy_db-v1beta 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-alloy_db-v1beta 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-alloy_db-v1beta 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-alloy_db-v1beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-alloy_db-v1beta" + header "google-cloud-alloy_db-v1beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-alloy_db-v1beta yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-alloy_db-v1beta 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-alloy_db-v1beta 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-alloy_db-v1beta 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-alloy_db-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-alloy_db-v1beta/gapic_metadata.json new file mode 100644 index 000000000000..7dd3dd41eaf9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/gapic_metadata.json @@ -0,0 +1,222 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.alloydb.v1beta", + "libraryPackage": "::Google::Cloud::AlloyDB::V1beta", + "services": { + "AlloyDBAdmin": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client", + "rpcs": { + "ListClusters": { + "methods": [ + "list_clusters" + ] + }, + "GetCluster": { + "methods": [ + "get_cluster" + ] + }, + "CreateCluster": { + "methods": [ + "create_cluster" + ] + }, + "UpdateCluster": { + "methods": [ + "update_cluster" + ] + }, + "ExportCluster": { + "methods": [ + "export_cluster" + ] + }, + "ImportCluster": { + "methods": [ + "import_cluster" + ] + }, + "UpgradeCluster": { + "methods": [ + "upgrade_cluster" + ] + }, + "DeleteCluster": { + "methods": [ + "delete_cluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promote_cluster" + ] + }, + "SwitchoverCluster": { + "methods": [ + "switchover_cluster" + ] + }, + "RestoreCluster": { + "methods": [ + "restore_cluster" + ] + }, + "CreateSecondaryCluster": { + "methods": [ + "create_secondary_cluster" + ] + }, + "ListInstances": { + "methods": [ + "list_instances" + ] + }, + "GetInstance": { + "methods": [ + "get_instance" + ] + }, + "CreateInstance": { + "methods": [ + "create_instance" + ] + }, + "CreateSecondaryInstance": { + "methods": [ + "create_secondary_instance" + ] + }, + "BatchCreateInstances": { + "methods": [ + "batch_create_instances" + ] + }, + "UpdateInstance": { + "methods": [ + "update_instance" + ] + }, + "DeleteInstance": { + "methods": [ + "delete_instance" + ] + }, + "FailoverInstance": { + "methods": [ + "failover_instance" + ] + }, + "InjectFault": { + "methods": [ + "inject_fault" + ] + }, + "RestartInstance": { + "methods": [ + "restart_instance" + ] + }, + "ExecuteSql": { + "methods": [ + "execute_sql" + ] + }, + "ListBackups": { + "methods": [ + "list_backups" + ] + }, + "GetBackup": { + "methods": [ + "get_backup" + ] + }, + "CreateBackup": { + "methods": [ + "create_backup" + ] + }, + "UpdateBackup": { + "methods": [ + "update_backup" + ] + }, + "DeleteBackup": { + "methods": [ + "delete_backup" + ] + }, + "ListSupportedDatabaseFlags": { + "methods": [ + "list_supported_database_flags" + ] + }, + "GenerateClientCertificate": { + "methods": [ + "generate_client_certificate" + ] + }, + "GetConnectionInfo": { + "methods": [ + "get_connection_info" + ] + }, + "ListUsers": { + "methods": [ + "list_users" + ] + }, + "GetUser": { + "methods": [ + "get_user" + ] + }, + "CreateUser": { + "methods": [ + "create_user" + ] + }, + "UpdateUser": { + "methods": [ + "update_user" + ] + }, + "DeleteUser": { + "methods": [ + "delete_user" + ] + }, + "ListDatabases": { + "methods": [ + "list_databases" + ] + }, + "CreateDatabase": { + "methods": [ + "create_database" + ] + } + } + } + } + }, + "AlloyDBCSQLAdmin": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client", + "rpcs": { + "RestoreFromCloudSQL": { + "methods": [ + "restore_from_cloud_sql" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/google-cloud-alloy_db-v1beta.gemspec b/owl-bot-staging/google-cloud-alloy_db-v1beta/google-cloud-alloy_db-v1beta.gemspec new file mode 100644 index 000000000000..a9baf96ac0c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/google-cloud-alloy_db-v1beta.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/alloy_db/v1beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-alloy_db-v1beta" + gem.version = Google::Cloud::AlloyDB::V1beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. Note that google-cloud-alloy_db-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-alloy_db instead. See the readme for more details." + gem.summary = "AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "google-iam-v1", "~> 1.3" +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google-cloud-alloy_db-v1beta.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google-cloud-alloy_db-v1beta.rb new file mode 100644 index 000000000000..021f5a816c80 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google-cloud-alloy_db-v1beta.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/alloy_db/v1beta" diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta.rb new file mode 100644 index 000000000000..d548aa8a53e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/alloy_db/v1beta/alloy_db_admin" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" +require "google/cloud/alloy_db/v1beta/version" + +module Google + module Cloud + module AlloyDB + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/alloy_db/v1beta" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/alloy_db/v1beta" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + module V1beta + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" +require "google/cloud/alloy_db/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb new file mode 100644 index 000000000000..03f5407b84c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/alloy_db/v1beta/version" + +require "google/cloud/alloy_db/v1beta/alloy_db_admin/credentials" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/paths" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/operations" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/client" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" + +module Google + module Cloud + module AlloyDB + module V1beta + ## + # Service describing handlers for resources + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/alloy_db/v1beta/alloy_db_admin" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + module AlloyDBAdmin + end + end + end + end +end + +helper_path = ::File.join __dir__, "alloy_db_admin", "helpers.rb" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb new file mode 100644 index 000000000000..c2276c68406f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb @@ -0,0 +1,4929 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/alloydb/v1beta/service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBAdmin + ## + # Client for the AlloyDBAdmin service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :alloy_db_admin_stub + + ## + # Configure the AlloyDBAdmin Client class. + # + # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AlloyDBAdmin clients + # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AlloyDB", "V1beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_clusters.timeout = 60.0 + default_config.rpcs.list_clusters.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_cluster.timeout = 60.0 + default_config.rpcs.get_cluster.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_instances.timeout = 60.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_instance.timeout = 60.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_backups.timeout = 60.0 + default_config.rpcs.list_backups.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_backup.timeout = 60.0 + default_config.rpcs.get_backup.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_supported_database_flags.timeout = 60.0 + default_config.rpcs.list_supported_database_flags.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.generate_client_certificate.timeout = 60.0 + default_config.rpcs.generate_client_certificate.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_connection_info.timeout = 60.0 + default_config.rpcs.get_connection_info.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_users.timeout = 60.0 + default_config.rpcs.list_users.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_user.timeout = 60.0 + default_config.rpcs.get_user.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_databases.timeout = 60.0 + default_config.rpcs.list_databases.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_database.timeout = 60.0 + default_config.rpcs.create_database.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 AlloyDBAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @alloy_db_admin_stub.universe_domain + end + + ## + # Create a new AlloyDBAdmin client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AlloyDBAdmin 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/alloydb/v1beta/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 + + @alloy_db_admin_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Stub, + credentials: credentials, + endpoint: @config.endpoint, + 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 + ) + + @alloy_db_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 + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @alloy_db_admin_stub.logger + end + + # Service calls + + ## + # Lists Clusters in a given project and location. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Cluster.name field. Additionally, you can perform an + # aggregated list operation by specifying a value with the following format: + # * projects/\\{project}/locations/- + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @param order_by [::String] + # Optional. Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Cluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Cluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_clusters.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :list_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_clusters, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single Cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_cluster(name: nil, view: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field. + # @param view [::Google::Cloud::AlloyDB::V1beta::ClusterView] + # Optional. The view of the cluster to return. Returns all default fields if + # not set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::Cluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :get_cluster, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new Cluster in a given project and location. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of the new cluster. For the required format, see the + # comment on the Cluster.name field. + # @param cluster_id [::String] + # Required. ID of the requesting object. + # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :create_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the parameters of a single Cluster. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Cluster 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 cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param allow_missing [::Boolean] + # Optional. If set to true, update succeeds even if cluster is not found. In + # that case, a new cluster is created and `update_mask` is ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.cluster&.name + header_params["cluster.name"] = request.cluster.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :update_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports data from the cluster. + # Imperative only. + # + # @overload export_cluster(request, options = nil) + # Pass arguments to `export_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_cluster(gcs_destination: nil, csv_export_options: nil, sql_export_options: nil, name: nil, database: nil) + # Pass arguments to `export_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_destination [::Google::Cloud::AlloyDB::V1beta::GcsDestination, ::Hash] + # Required. Option to export data to cloud storage. + # @param csv_export_options [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::CsvExportOptions, ::Hash] + # Options for exporting data in CSV format. Required field to be set for + # CSV file type. + # + # Note: The following parameters are mutually exclusive: `csv_export_options`, `sql_export_options`. 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 sql_export_options [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::SqlExportOptions, ::Hash] + # Options for exporting data in SQL format. Required field to be set for + # SQL file type. + # + # Note: The following parameters are mutually exclusive: `sql_export_options`, `csv_export_options`. 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 name [::String] + # Required. The resource name of the cluster. + # @param database [::String] + # Required. Name of the database where the export command will be executed. + # Note - Value provided should be the same as expected from + # `SELECT current_database();` and NOT as a resource reference. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new + # + # # Call the export_cluster method. + # result = client.export_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.export_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :export_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports data to the cluster. + # Imperative only. + # + # @overload import_cluster(request, options = nil) + # Pass arguments to `import_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload import_cluster(sql_import_options: nil, csv_import_options: nil, name: nil, gcs_uri: nil, database: nil, user: nil) + # Pass arguments to `import_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param sql_import_options [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::SqlImportOptions, ::Hash] + # Options for importing data in SQL format. + # + # Note: The following parameters are mutually exclusive: `sql_import_options`, `csv_import_options`. 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 csv_import_options [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::CsvImportOptions, ::Hash] + # Options for importing data in CSV format. + # + # Note: The following parameters are mutually exclusive: `csv_import_options`, `sql_import_options`. 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 name [::String] + # Required. The resource name of the cluster. + # @param gcs_uri [::String] + # Required. The path to the file in Google Cloud Storage where the source + # file for import will be stored. The URI is in the form + # `gs://bucketName/fileName`. + # @param database [::String] + # Optional. Name of the database to which the import will be done. + # For import from SQL file, this is required only if the file does not + # specify a database. + # Note - Value provided should be the same as expected from `SELECT + # current_database();` and NOT as a resource reference. + # @param user [::String] + # Optional. Database user to be used for importing the data. + # Note - Value provided should be the same as expected from + # `SELECT current_user;` and NOT as a resource reference. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new + # + # # Call the import_cluster method. + # result = client.import_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.import_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.import_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :import_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Upgrades a single Cluster. + # Imperative only. + # + # @overload upgrade_cluster(request, options = nil) + # Pass arguments to `upgrade_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upgrade_cluster(name: nil, version: nil, request_id: nil, validate_only: nil, etag: nil) + # Pass arguments to `upgrade_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the cluster. + # @param version [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] + # Required. The version the cluster is going to be upgraded to. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param etag [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # upgrade will be blocked and an ABORTED error will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new + # + # # Call the upgrade_cluster method. + # result = client.upgrade_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def upgrade_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.upgrade_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.upgrade_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upgrade_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :upgrade_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single Cluster. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil, force: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param etag [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # deletion will be blocked and an ABORTED error will be returned. + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param force [::Boolean] + # Optional. Whether to cascade delete child instances for given cluster. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :delete_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Promotes a SECONDARY cluster. This turns down replication + # from the PRIMARY cluster and promotes a secondary cluster + # into its own standalone cluster. + # Imperative only. + # + # @overload promote_cluster(request, options = nil) + # Pass arguments to `promote_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil) + # Pass arguments to `promote_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param etag [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # deletion will be blocked and an ABORTED error will be returned. + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new + # + # # Call the promote_cluster method. + # result = client.promote_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def promote_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.promote_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.promote_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :promote_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Switches the roles of PRIMARY and SECONDARY clusters without any data loss. + # This promotes the SECONDARY cluster to PRIMARY and sets up the original + # PRIMARY cluster to replicate from this newly promoted cluster. + # + # @overload switchover_cluster(request, options = nil) + # Pass arguments to `switchover_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload switchover_cluster(name: nil, request_id: nil, validate_only: nil) + # Pass arguments to `switchover_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new + # + # # Call the switchover_cluster method. + # result = client.switchover_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def switchover_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.switchover_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.switchover_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.switchover_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :switchover_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new Cluster in a given project and location, with a volume + # restored from the provided source, either a backup ID or a point-in-time + # and a source cluster. + # + # @overload restore_cluster(request, options = nil) + # Pass arguments to `restore_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `restore_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param backup_source [::Google::Cloud::AlloyDB::V1beta::BackupSource, ::Hash] + # Backup source. + # + # Note: The following parameters are mutually exclusive: `backup_source`, `continuous_backup_source`. 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 continuous_backup_source [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupSource, ::Hash] + # ContinuousBackup source. Continuous backup needs to be enabled in the + # source cluster for this operation to succeed. + # + # Note: The following parameters are mutually exclusive: `continuous_backup_source`, `backup_source`. 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 parent [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Cluster.name field. + # @param cluster_id [::String] + # Required. ID of the requesting object. + # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new + # + # # Call the restore_cluster method. + # result = client.restore_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def restore_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest + + # Converts hash and nil to 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_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :restore_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a cluster of type SECONDARY in the given location using + # the primary cluster as the source. + # + # @overload create_secondary_cluster(request, options = nil) + # Pass arguments to `create_secondary_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of the new cluster. For the required + # format, see the comment on the Cluster.name field. + # @param cluster_id [::String] + # Required. ID of the requesting object (the secondary cluster). + # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash] + # Required. Configuration of the requesting object (the secondary cluster). + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new + # + # # Call the create_secondary_cluster method. + # result = client.create_secondary_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_secondary_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_secondary_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_secondary_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :create_secondary_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Instances in a given project and location. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Instance.name field. Additionally, you can perform an + # aggregated list operation by specifying a value with one of the following + # formats: + # * projects/\\{project}/locations/-/clusters/- + # * projects/\\{project}/locations/\\{region}/clusters/- + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @param order_by [::String] + # Optional. Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Instance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Instance>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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 + + @alloy_db_admin_stub.call_rpc :list_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @alloy_db_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 + + ## + # Gets details of a single Instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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, view: 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 resource. For the required format, see the + # comment on the Instance.name field. + # @param view [::Google::Cloud::AlloyDB::V1beta::InstanceView] + # The view of the instance to return. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::Instance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Instance] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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 + + @alloy_db_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 a new Instance in a given project and location. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: 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 parent resource. For the required format, see the + # comment on the Instance.name field. + # @param instance_id [::String] + # Required. ID of the requesting object. + # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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 + + @alloy_db_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 + + ## + # Creates a new SECONDARY Instance in a given project and location. + # + # @overload create_secondary_instance(request, options = nil) + # Pass arguments to `create_secondary_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_secondary_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 parent resource. For the required format, see the + # comment on the Instance.name field. + # @param instance_id [::String] + # Required. ID of the requesting object. + # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new + # + # # Call the create_secondary_instance method. + # result = client.create_secondary_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_secondary_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_secondary_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_secondary_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :create_secondary_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 + + ## + # Creates new instances under the given project, location and cluster. + # There can be only one primary instance in a cluster. If the primary + # instance exists in the cluster as well as this request, then API will + # throw an error. + # The primary instance should exist before any read pool instance is + # created. If the primary instance is a part of the request payload, then + # the API will take care of creating instances in the correct order. + # This method is here to support Google-internal use cases, and is not meant + # for external customers to consume. Please do not start relying on it; its + # behavior is subject to change without notice. + # + # @overload batch_create_instances(request, options = nil) + # Pass arguments to `batch_create_instances` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, requests: nil, request_id: nil) + # Pass arguments to `batch_create_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 parent resource. + # @param requests [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests, ::Hash] + # Required. Resources 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new + # + # # Call the batch_create_instances method. + # result = client.batch_create_instances request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest + + # Converts hash and nil to 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_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :batch_create_instances, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 parameters of a single Instance. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_instance(update_mask: nil, instance: nil, request_id: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Instance 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 instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param allow_missing [::Boolean] + # Optional. If set to true, update succeeds even if instance is not found. In + # that case, a new instance is created and `update_mask` is ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-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 + + @alloy_db_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 a single Instance. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_instance(name: nil, request_id: nil, etag: nil, validate_only: 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 resource. For the required format, see the + # comment on the Instance.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param etag [::String] + # Optional. The current etag of the Instance. + # If an etag is provided and does not match the current etag of the Instance, + # deletion will be blocked and an ABORTED error will be returned. + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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 + + @alloy_db_admin_stub.call_rpc :delete_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a Failover for a highly available instance. + # Failover promotes the HA standby instance as the new primary. + # Imperative only. + # + # @overload failover_instance(request, options = nil) + # Pass arguments to `failover_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload failover_instance(name: nil, request_id: nil, validate_only: nil) + # Pass arguments to `failover_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new + # + # # Call the failover_instance method. + # result = client.failover_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def failover_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.failover_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.failover_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.failover_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :failover_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Injects fault in an instance. + # Imperative only. + # + # @overload inject_fault(request, options = nil) + # Pass arguments to `inject_fault` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil) + # Pass arguments to `inject_fault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param fault_type [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest::FaultType] + # Required. The type of fault to be injected in an instance. + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new + # + # # Call the inject_fault method. + # result = client.inject_fault request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def inject_fault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.inject_fault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.inject_fault.timeout, + metadata: metadata, + retry_policy: @config.rpcs.inject_fault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :inject_fault, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Restart an Instance in a cluster. + # Imperative only. + # + # @overload restart_instance(request, options = nil) + # Pass arguments to `restart_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload restart_instance(name: nil, request_id: nil, validate_only: nil, node_ids: nil) + # Pass arguments to `restart_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 resource. For the required format, see the + # comment on the Instance.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param node_ids [::Array<::String>] + # Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + # restart upon. Applicable only to read 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new + # + # # Call the restart_instance method. + # result = client.restart_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 restart_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.restart_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.restart_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restart_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :restart_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 + + ## + # Executes a SQL statement in a database inside an AlloyDB instance. + # + # @overload execute_sql(request, options = nil) + # Pass arguments to `execute_sql` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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(password: nil, instance: nil, database: nil, user: nil, sql_statement: nil, validate_only: 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 password [::String] + # Optional. The database native user’s password. + # @param instance [::String] + # Required. The instance where the SQL will be executed. For the required + # format, see the comment on the Instance.name field. + # @param database [::String] + # Required. Name of the database where the query will be executed. + # Note - Value provided should be the same as expected from `SELECT + # current_database();` and NOT as a resource reference. + # @param user [::String] + # Required. Database user to be used for executing the SQL. + # Note - Value provided should be the same as expected from + # `SELECT current_user;` and NOT as a resource reference. + # @param sql_statement [::String] + # Required. SQL statement to execute on database. Any valid statement is + # permitted, including DDL, DML, DQL statements. + # @param validate_only [::Boolean] + # Optional. If set, validates the sql statement by performing + # syntax and semantic validation and doesn't execute the query. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new + # + # # Call the execute_sql method. + # result = client.execute_sql request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse. + # 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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-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 + header_params["instance"] = request.instance + end + + request_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 + + @alloy_db_admin_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 + + ## + # Lists Backups in a given project and location. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: 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. Parent value for ListBackupsRequest + # @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::AlloyDB::V1beta::Backup>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Backup>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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 + + @alloy_db_admin_stub.call_rpc :list_backups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @alloy_db_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 + + ## + # Gets details of a single Backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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 resource + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::Backup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Backup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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 + + @alloy_db_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 + + ## + # Creates a new Backup in a given project and location. + # + # @overload create_backup(request, options = nil) + # Pass arguments to `create_backup` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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, request_id: nil, validate_only: 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. Value for parent. + # @param backup_id [::String] + # Required. ID of the requesting object. + # @param backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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 + + @alloy_db_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 + + ## + # Updates the parameters of a single Backup. + # + # @overload update_backup(request, options = nil) + # Pass arguments to `update_backup` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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(update_mask: nil, backup: nil, request_id: nil, validate_only: nil, allow_missing: 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Backup 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 backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @param allow_missing [::Boolean] + # Optional. If set to true, update succeeds even if instance is not found. In + # that case, a new backup is created and `update_mask` is ignored. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new + # + # # Call the update_backup method. + # result = client.update_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 update_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-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 + + @alloy_db_admin_stub.call_rpc :update_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 + + ## + # Deletes a single Backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil, validate_only: nil, etag: 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 resource. For the required format, see the comment on + # the Backup.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @param etag [::String] + # Optional. The current etag of the Backup. + # If an etag is provided and does not match the current etag of the Backup, + # deletion will be blocked and an ABORTED error will be returned. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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 + + @alloy_db_admin_stub.call_rpc :delete_backup, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists SupportedDatabaseFlags for a given project and location. + # + # @overload list_supported_database_flags(request, options = nil) + # Pass arguments to `list_supported_database_flags` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_supported_database_flags(parent: nil, page_size: nil, page_token: nil, scope: nil) + # Pass arguments to `list_supported_database_flags` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. The required format is: + # * projects/\\{project}/locations/\\{location} + # + # Regardless of the parent specified here, as long it is contains a valid + # project and location, the service will return a static list of supported + # flags resources. Note that we do not yet support region-specific + # flags. + # @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 scope [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::Scope] + # Optional. The scope for which supported flags are requested. If not + # specified, default is DATABASE. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new + # + # # Call the list_supported_database_flags method. + # result = client.list_supported_database_flags request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag. + # p item + # end + # + def list_supported_database_flags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_supported_database_flags.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_supported_database_flags.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_supported_database_flags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :list_supported_database_flags, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generate a client certificate signed by a Cluster CA. + # The sole purpose of this endpoint is to support AlloyDB connectors and the + # Auth Proxy client. The endpoint's behavior is subject to change without + # notice, so do not rely on its behavior remaining constant. Future changes + # will not break AlloyDB connectors or the Auth Proxy client. + # + # @overload generate_client_certificate(request, options = nil) + # Pass arguments to `generate_client_certificate` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil, public_key: nil, use_metadata_exchange: nil) + # Pass arguments to `generate_client_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. The required format is: + # * projects/\\{project}/locations/\\{location}/clusters/\\{cluster} + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param pem_csr [::String] + # Optional. A pem-encoded X.509 certificate signing request (CSR). It is + # recommended to use public_key instead. + # @param cert_duration [::Google::Protobuf::Duration, ::Hash] + # Optional. An optional hint to the endpoint to generate the client + # certificate with the requested duration. The duration can be from 1 hour to + # 24 hours. The endpoint may or may not honor the hint. If the hint is left + # unspecified or is not honored, then the endpoint will pick an appropriate + # default duration. + # @param public_key [::String] + # Optional. The public key from the client. + # @param use_metadata_exchange [::Boolean] + # Optional. An optional hint to the endpoint to generate a client certificate + # that can be used by AlloyDB connectors to exchange additional metadata with + # the server after TLS handshake. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new + # + # # Call the generate_client_certificate method. + # result = client.generate_client_certificate request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse. + # p result + # + def generate_client_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest + + # Converts hash and nil to 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_client_certificate.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.generate_client_certificate.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_client_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :generate_client_certificate, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get instance metadata used for a connection. + # + # @overload get_connection_info(request, options = nil) + # Pass arguments to `get_connection_info` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_connection_info(parent: nil, request_id: nil) + # Pass arguments to `get_connection_info` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. The required format is: + # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance} + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate 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::AlloyDB::V1beta::ConnectionInfo] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new + # + # # Call the get_connection_info method. + # result = client.get_connection_info request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::ConnectionInfo. + # p result + # + def get_connection_info request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_connection_info.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_connection_info.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_connection_info.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :get_connection_info, request, 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 Users in a given project and location. + # + # @overload list_users(request, options = nil) + # Pass arguments to `list_users` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListUsersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_users` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 ListUsersRequest + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @param order_by [::String] + # Optional. Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::User>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::User>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ListUsersRequest.new + # + # # Call the list_users method. + # result = client.list_users request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::User. + # p item + # end + # + def list_users request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_users.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_users.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_users.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :list_users, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_users, request, response, 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 User. + # + # @overload get_user(request, options = nil) + # Pass arguments to `get_user` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::GetUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_user(name: nil) + # Pass arguments to `get_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the User.name field. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetUserRequest.new + # + # # Call the get_user method. + # result = client.get_user request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + # p result + # + def get_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_user.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :get_user, request, 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 User in a given project, location, and cluster. + # + # @overload create_user(request, options = nil) + # Pass arguments to `create_user` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 user_id [::String] + # Required. ID of the requesting object. + # @param user [::Google::Cloud::AlloyDB::V1beta::User, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new + # + # # Call the create_user method. + # result = client.create_user request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + # p result + # + def create_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_user.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :create_user, request, 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 User. + # + # @overload update_user(request, options = nil) + # Pass arguments to `update_user` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # User 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 user [::Google::Cloud::AlloyDB::V1beta::User, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @param allow_missing [::Boolean] + # Optional. Allow missing fields in the update mask. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new + # + # # Call the update_user method. + # result = client.update_user request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + # p result + # + def update_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.user&.name + header_params["user.name"] = request.user.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_user.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :update_user, request, 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 User. + # + # @overload delete_user(request, options = nil) + # Pass arguments to `delete_user` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_user(name: nil, request_id: nil, validate_only: nil) + # Pass arguments to `delete_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the User.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new + # + # # Call the delete_user method. + # result = client.delete_user request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_user.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.call_rpc :delete_user, request, 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 Databases in a given project and location. + # + # @overload list_databases(request, options = nil) + # Pass arguments to `list_databases` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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, filter: 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. Parent value for ListDatabasesRequest. + # @param page_size [::Integer] + # Optional. The maximum number of databases to return. The service may return + # fewer than this value. If unspecified, 2000 is the default page_size. The + # max value of page_size will be 4000, values above max will be coerced to + # max. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDatabases` call. + # This should be provided to retrieve the subsequent page. + # This field is currently not supported, its value will be ignored if passed. + # @param filter [::String] + # Optional. Filtering results. + # This field is currently not supported, its value will be ignored if passed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Database>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Database>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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 + + @alloy_db_admin_stub.call_rpc :list_databases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @alloy_db_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 Database in a given project, location, and cluster. + # + # @overload create_database(request, options = nil) + # Pass arguments to `create_database` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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, database_id: nil, database: 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. Value for parent. + # @param database_id [::String] + # Required. ID of the requesting object. + # @param database [::Google::Cloud::AlloyDB::V1beta::Database, ::Hash] + # Required. The resource being created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::Database] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Database] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new + # + # # Call the create_database method. + # result = client.create_database request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::Database. + # p result + # + def create_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_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 + + @alloy_db_admin_stub.call_rpc :create_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 + + ## + # Configuration class for the AlloyDBAdmin API. + # + # This class represents the configuration for AlloyDBAdmin, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "alloydb.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AlloyDBAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `export_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :export_cluster + ## + # RPC-specific configuration for `import_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :import_cluster + ## + # RPC-specific configuration for `upgrade_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `promote_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :promote_cluster + ## + # RPC-specific configuration for `switchover_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :switchover_cluster + ## + # RPC-specific configuration for `restore_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_cluster + ## + # RPC-specific configuration for `create_secondary_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secondary_cluster + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `create_secondary_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secondary_instance + ## + # RPC-specific configuration for `batch_create_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_instances + ## + # 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 `failover_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :failover_instance + ## + # RPC-specific configuration for `inject_fault` + # @return [::Gapic::Config::Method] + # + attr_reader :inject_fault + ## + # RPC-specific configuration for `restart_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :restart_instance + ## + # RPC-specific configuration for `execute_sql` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_sql + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `create_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :create_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_supported_database_flags` + # @return [::Gapic::Config::Method] + # + attr_reader :list_supported_database_flags + ## + # RPC-specific configuration for `generate_client_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_client_certificate + ## + # RPC-specific configuration for `get_connection_info` + # @return [::Gapic::Config::Method] + # + attr_reader :get_connection_info + ## + # RPC-specific configuration for `list_users` + # @return [::Gapic::Config::Method] + # + attr_reader :list_users + ## + # RPC-specific configuration for `get_user` + # @return [::Gapic::Config::Method] + # + attr_reader :get_user + ## + # RPC-specific configuration for `create_user` + # @return [::Gapic::Config::Method] + # + attr_reader :create_user + ## + # RPC-specific configuration for `update_user` + # @return [::Gapic::Config::Method] + # + attr_reader :update_user + ## + # RPC-specific configuration for `delete_user` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_user + ## + # 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 + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + export_cluster_config = parent_rpcs.export_cluster if parent_rpcs.respond_to? :export_cluster + @export_cluster = ::Gapic::Config::Method.new export_cluster_config + import_cluster_config = parent_rpcs.import_cluster if parent_rpcs.respond_to? :import_cluster + @import_cluster = ::Gapic::Config::Method.new import_cluster_config + upgrade_cluster_config = parent_rpcs.upgrade_cluster if parent_rpcs.respond_to? :upgrade_cluster + @upgrade_cluster = ::Gapic::Config::Method.new upgrade_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster + @promote_cluster = ::Gapic::Config::Method.new promote_cluster_config + switchover_cluster_config = parent_rpcs.switchover_cluster if parent_rpcs.respond_to? :switchover_cluster + @switchover_cluster = ::Gapic::Config::Method.new switchover_cluster_config + restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster + @restore_cluster = ::Gapic::Config::Method.new restore_cluster_config + create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster + @create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance + @create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config + batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances + @batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_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 + failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance + @failover_instance = ::Gapic::Config::Method.new failover_instance_config + inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault + @inject_fault = ::Gapic::Config::Method.new inject_fault_config + restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance + @restart_instance = ::Gapic::Config::Method.new restart_instance_config + execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql + @execute_sql = ::Gapic::Config::Method.new execute_sql_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup + @create_backup = ::Gapic::Config::Method.new create_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_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags + @list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config + generate_client_certificate_config = parent_rpcs.generate_client_certificate if parent_rpcs.respond_to? :generate_client_certificate + @generate_client_certificate = ::Gapic::Config::Method.new generate_client_certificate_config + get_connection_info_config = parent_rpcs.get_connection_info if parent_rpcs.respond_to? :get_connection_info + @get_connection_info = ::Gapic::Config::Method.new get_connection_info_config + list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users + @list_users = ::Gapic::Config::Method.new list_users_config + get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user + @get_user = ::Gapic::Config::Method.new get_user_config + create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user + @create_user = ::Gapic::Config::Method.new create_user_config + update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user + @update_user = ::Gapic::Config::Method.new update_user_config + delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user + @delete_user = ::Gapic::Config::Method.new delete_user_config + 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 + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb new file mode 100644 index 000000000000..f238b11dc00d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBAdmin + # Credentials for the AlloyDBAdmin 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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb new file mode 100644 index 000000000000..b8ec489b85c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBAdmin + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AlloyDBAdmin 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 AlloyDBAdmin 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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::AlloyDB::V1beta::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 = "alloydb.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb new file mode 100644 index 000000000000..420dba730fe8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb @@ -0,0 +1,231 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBAdmin + # Path helper methods for the AlloyDBAdmin API. + module Paths + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backups/{backup}` + # + # @param project [String] + # @param location [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, location:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backups/#{backup}" + end + + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified Database resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param database [String] + # + # @return [::String] + def database_path project:, location:, cluster:, database: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/databases/#{database}" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, cluster:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/instances/#{instance}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified ServiceAttachment resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` + # + # @param project [String] + # @param region [String] + # @param service_attachment [String] + # + # @return [::String] + def service_attachment_path project:, region:, service_attachment: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" + end + + ## + # Create a fully-qualified User resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/users/{user}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param user [String] + # + # @return [::String] + def user_path project:, location:, cluster:, user: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/users/#{user}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb new file mode 100644 index 000000000000..be41474bfee0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/alloy_db/v1beta/version" +require "google/cloud/alloy_db/v1beta/bindings_override" + +require "google/cloud/alloy_db/v1beta/alloy_db_admin/credentials" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/paths" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client" + +module Google + module Cloud + module AlloyDB + module V1beta + ## + # Service describing handlers for resources + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + module AlloyDBAdmin + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb new file mode 100644 index 000000000000..210a4ce32653 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb @@ -0,0 +1,4628 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/alloydb/v1beta/service_pb" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBAdmin + module Rest + ## + # REST client for the AlloyDBAdmin service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :alloy_db_admin_stub + + ## + # Configure the AlloyDBAdmin Client class. + # + # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AlloyDBAdmin clients + # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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", "AlloyDB", "V1beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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_clusters.timeout = 60.0 + default_config.rpcs.list_clusters.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_cluster.timeout = 60.0 + default_config.rpcs.get_cluster.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_instances.timeout = 60.0 + default_config.rpcs.list_instances.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_instance.timeout = 60.0 + default_config.rpcs.get_instance.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_backups.timeout = 60.0 + default_config.rpcs.list_backups.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_backup.timeout = 60.0 + default_config.rpcs.get_backup.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_supported_database_flags.timeout = 60.0 + default_config.rpcs.list_supported_database_flags.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.generate_client_certificate.timeout = 60.0 + default_config.rpcs.generate_client_certificate.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_connection_info.timeout = 60.0 + default_config.rpcs.get_connection_info.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_users.timeout = 60.0 + default_config.rpcs.list_users.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_user.timeout = 60.0 + default_config.rpcs.get_user.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_databases.timeout = 60.0 + default_config.rpcs.list_databases.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_database.timeout = 60.0 + default_config.rpcs.create_database.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 AlloyDBAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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 + @alloy_db_admin_stub.universe_domain + end + + ## + # Create a new AlloyDBAdmin REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AlloyDBAdmin 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::AlloyDB::V1beta::AlloyDBAdmin::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 + + @alloy_db_admin_stub = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @alloy_db_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 + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_admin_stub.endpoint + config.universe_domain = @alloy_db_admin_stub.universe_domain + config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @alloy_db_admin_stub.logger + end + + # Service calls + + ## + # Lists Clusters in a given project and location. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Cluster.name field. Additionally, you can perform an + # aggregated list operation by specifying a value with the following format: + # * projects/\\{project}/locations/- + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @param order_by [::String] + # Optional. Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Cluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Cluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_clusters.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.list_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_clusters, "clusters", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single Cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_cluster(name: nil, view: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field. + # @param view [::Google::Cloud::AlloyDB::V1beta::ClusterView] + # Optional. The view of the cluster to return. Returns all default fields if + # not set. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.get_cluster request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new Cluster in a given project and location. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of the new cluster. For the required format, see the + # comment on the Cluster.name field. + # @param cluster_id [::String] + # Required. ID of the requesting object. + # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.create_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the parameters of a single Cluster. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Cluster 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 cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param allow_missing [::Boolean] + # Optional. If set to true, update succeeds even if cluster is not found. In + # that case, a new cluster is created and `update_mask` is ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.update_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Exports data from the cluster. + # Imperative only. + # + # @overload export_cluster(request, options = nil) + # Pass arguments to `export_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_cluster(gcs_destination: nil, csv_export_options: nil, sql_export_options: nil, name: nil, database: nil) + # Pass arguments to `export_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param gcs_destination [::Google::Cloud::AlloyDB::V1beta::GcsDestination, ::Hash] + # Required. Option to export data to cloud storage. + # @param csv_export_options [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::CsvExportOptions, ::Hash] + # Options for exporting data in CSV format. Required field to be set for + # CSV file type. + # + # Note: The following parameters are mutually exclusive: `csv_export_options`, `sql_export_options`. 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 sql_export_options [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::SqlExportOptions, ::Hash] + # Options for exporting data in SQL format. Required field to be set for + # SQL file type. + # + # Note: The following parameters are mutually exclusive: `sql_export_options`, `csv_export_options`. 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 name [::String] + # Required. The resource name of the cluster. + # @param database [::String] + # Required. Name of the database where the export command will be executed. + # Note - Value provided should be the same as expected from + # `SELECT current_database();` and NOT as a resource reference. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new + # + # # Call the export_cluster method. + # result = client.export_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def export_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.export_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.export_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Imports data to the cluster. + # Imperative only. + # + # @overload import_cluster(request, options = nil) + # Pass arguments to `import_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload import_cluster(sql_import_options: nil, csv_import_options: nil, name: nil, gcs_uri: nil, database: nil, user: nil) + # Pass arguments to `import_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param sql_import_options [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::SqlImportOptions, ::Hash] + # Options for importing data in SQL format. + # + # Note: The following parameters are mutually exclusive: `sql_import_options`, `csv_import_options`. 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 csv_import_options [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::CsvImportOptions, ::Hash] + # Options for importing data in CSV format. + # + # Note: The following parameters are mutually exclusive: `csv_import_options`, `sql_import_options`. 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 name [::String] + # Required. The resource name of the cluster. + # @param gcs_uri [::String] + # Required. The path to the file in Google Cloud Storage where the source + # file for import will be stored. The URI is in the form + # `gs://bucketName/fileName`. + # @param database [::String] + # Optional. Name of the database to which the import will be done. + # For import from SQL file, this is required only if the file does not + # specify a database. + # Note - Value provided should be the same as expected from `SELECT + # current_database();` and NOT as a resource reference. + # @param user [::String] + # Optional. Database user to be used for importing the data. + # Note - Value provided should be the same as expected from + # `SELECT current_user;` and NOT as a resource reference. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new + # + # # Call the import_cluster method. + # result = client.import_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def import_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.import_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.import_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.import_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Upgrades a single Cluster. + # Imperative only. + # + # @overload upgrade_cluster(request, options = nil) + # Pass arguments to `upgrade_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload upgrade_cluster(name: nil, version: nil, request_id: nil, validate_only: nil, etag: nil) + # Pass arguments to `upgrade_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the cluster. + # @param version [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] + # Required. The version the cluster is going to be upgraded to. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param etag [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # upgrade will be blocked and an ABORTED error will be returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new + # + # # Call the upgrade_cluster method. + # result = client.upgrade_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def upgrade_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.upgrade_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.upgrade_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upgrade_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.upgrade_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single Cluster. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil, force: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param etag [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # deletion will be blocked and an ABORTED error will be returned. + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param force [::Boolean] + # Optional. Whether to cascade delete child instances for given cluster. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.delete_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Promotes a SECONDARY cluster. This turns down replication + # from the PRIMARY cluster and promotes a secondary cluster + # into its own standalone cluster. + # Imperative only. + # + # @overload promote_cluster(request, options = nil) + # Pass arguments to `promote_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil) + # Pass arguments to `promote_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param etag [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # deletion will be blocked and an ABORTED error will be returned. + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new + # + # # Call the promote_cluster method. + # result = client.promote_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def promote_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.promote_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.promote_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.promote_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Switches the roles of PRIMARY and SECONDARY clusters without any data loss. + # This promotes the SECONDARY cluster to PRIMARY and sets up the original + # PRIMARY cluster to replicate from this newly promoted cluster. + # + # @overload switchover_cluster(request, options = nil) + # Pass arguments to `switchover_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload switchover_cluster(name: nil, request_id: nil, validate_only: nil) + # Pass arguments to `switchover_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new + # + # # Call the switchover_cluster method. + # result = client.switchover_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def switchover_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.switchover_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.switchover_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.switchover_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.switchover_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new Cluster in a given project and location, with a volume + # restored from the provided source, either a backup ID or a point-in-time + # and a source cluster. + # + # @overload restore_cluster(request, options = nil) + # Pass arguments to `restore_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `restore_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param backup_source [::Google::Cloud::AlloyDB::V1beta::BackupSource, ::Hash] + # Backup source. + # + # Note: The following parameters are mutually exclusive: `backup_source`, `continuous_backup_source`. 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 continuous_backup_source [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupSource, ::Hash] + # ContinuousBackup source. Continuous backup needs to be enabled in the + # source cluster for this operation to succeed. + # + # Note: The following parameters are mutually exclusive: `continuous_backup_source`, `backup_source`. 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 parent [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Cluster.name field. + # @param cluster_id [::String] + # Required. ID of the requesting object. + # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new + # + # # Call the restore_cluster method. + # result = client.restore_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def restore_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest + + # Converts hash and nil to an 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_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.restore_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a cluster of type SECONDARY in the given location using + # the primary cluster as the source. + # + # @overload create_secondary_cluster(request, options = nil) + # Pass arguments to `create_secondary_cluster` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location of the new cluster. For the required + # format, see the comment on the Cluster.name field. + # @param cluster_id [::String] + # Required. ID of the requesting object (the secondary cluster). + # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash] + # Required. Configuration of the requesting object (the secondary cluster). + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new + # + # # Call the create_secondary_cluster method. + # result = client.create_secondary_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_secondary_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_secondary_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_secondary_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.create_secondary_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Instances in a given project and location. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_instances` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Instance.name field. Additionally, you can perform an + # aggregated list operation by specifying a value with one of the following + # formats: + # * projects/\\{project}/locations/-/clusters/- + # * projects/\\{project}/locations/\\{region}/clusters/- + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @param order_by [::String] + # Optional. Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Instance>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Instance>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_admin_stub.list_instances request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_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 + + ## + # Gets details of a single Instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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, view: 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 resource. For the required format, see the + # comment on the Instance.name field. + # @param view [::Google::Cloud::AlloyDB::V1beta::InstanceView] + # The view of the instance to return. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Instance] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_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 a new Instance in a given project and location. + # + # @overload create_instance(request, options = nil) + # Pass arguments to `create_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: 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 parent resource. For the required format, see the + # comment on the Instance.name field. + # @param instance_id [::String] + # Required. ID of the requesting object. + # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_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 + + ## + # Creates a new SECONDARY Instance in a given project and location. + # + # @overload create_secondary_instance(request, options = nil) + # Pass arguments to `create_secondary_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_secondary_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 parent resource. For the required format, see the + # comment on the Instance.name field. + # @param instance_id [::String] + # Required. ID of the requesting object. + # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash] + # Required. The resource being created + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new + # + # # Call the create_secondary_instance method. + # result = client.create_secondary_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_secondary_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_secondary_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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_secondary_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.create_secondary_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 + + ## + # Creates new instances under the given project, location and cluster. + # There can be only one primary instance in a cluster. If the primary + # instance exists in the cluster as well as this request, then API will + # throw an error. + # The primary instance should exist before any read pool instance is + # created. If the primary instance is a part of the request payload, then + # the API will take care of creating instances in the correct order. + # This method is here to support Google-internal use cases, and is not meant + # for external customers to consume. Please do not start relying on it; its + # behavior is subject to change without notice. + # + # @overload batch_create_instances(request, options = nil) + # Pass arguments to `batch_create_instances` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, requests: nil, request_id: nil) + # Pass arguments to `batch_create_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 parent resource. + # @param requests [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests, ::Hash] + # Required. Resources 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new + # + # # Call the batch_create_instances method. + # result = client.batch_create_instances request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest + + # Converts hash and nil to an 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_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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.batch_create_instances request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 parameters of a single Instance. + # + # @overload update_instance(request, options = nil) + # Pass arguments to `update_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_instance(update_mask: nil, instance: nil, request_id: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Instance 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 instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param allow_missing [::Boolean] + # Optional. If set to true, update succeeds even if instance is not found. In + # that case, a new instance is created and `update_mask` is ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_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 a single Instance. + # + # @overload delete_instance(request, options = nil) + # Pass arguments to `delete_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_instance(name: nil, request_id: nil, etag: nil, validate_only: 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 resource. For the required format, see the + # comment on the Instance.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param etag [::String] + # Optional. The current etag of the Instance. + # If an etag is provided and does not match the current etag of the Instance, + # deletion will be blocked and an ABORTED error will be returned. + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new + # + # # Call the delete_instance method. + # result = client.delete_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_admin_stub.delete_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Forces a Failover for a highly available instance. + # Failover promotes the HA standby instance as the new primary. + # Imperative only. + # + # @overload failover_instance(request, options = nil) + # Pass arguments to `failover_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload failover_instance(name: nil, request_id: nil, validate_only: nil) + # Pass arguments to `failover_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new + # + # # Call the failover_instance method. + # result = client.failover_instance request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def failover_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.failover_instance.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.failover_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.failover_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.failover_instance request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Injects fault in an instance. + # Imperative only. + # + # @overload inject_fault(request, options = nil) + # Pass arguments to `inject_fault` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil) + # Pass arguments to `inject_fault` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param fault_type [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest::FaultType] + # Required. The type of fault to be injected in an instance. + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new + # + # # Call the inject_fault method. + # result = client.inject_fault request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def inject_fault request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.inject_fault.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.inject_fault.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.inject_fault.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.inject_fault request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Restart an Instance in a cluster. + # Imperative only. + # + # @overload restart_instance(request, options = nil) + # Pass arguments to `restart_instance` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload restart_instance(name: nil, request_id: nil, validate_only: nil, node_ids: nil) + # Pass arguments to `restart_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 resource. For the required format, see the + # comment on the Instance.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @param node_ids [::Array<::String>] + # Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + # restart upon. Applicable only to read 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new + # + # # Call the restart_instance method. + # result = client.restart_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 restart_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.restart_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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.restart_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restart_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.restart_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 + + ## + # Executes a SQL statement in a database inside an AlloyDB instance. + # + # @overload execute_sql(request, options = nil) + # Pass arguments to `execute_sql` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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(password: nil, instance: nil, database: nil, user: nil, sql_statement: nil, validate_only: 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 password [::String] + # Optional. The database native user’s password. + # @param instance [::String] + # Required. The instance where the SQL will be executed. For the required + # format, see the comment on the Instance.name field. + # @param database [::String] + # Required. Name of the database where the query will be executed. + # Note - Value provided should be the same as expected from `SELECT + # current_database();` and NOT as a resource reference. + # @param user [::String] + # Required. Database user to be used for executing the SQL. + # Note - Value provided should be the same as expected from + # `SELECT current_user;` and NOT as a resource reference. + # @param sql_statement [::String] + # Required. SQL statement to execute on database. Any valid statement is + # permitted, including DDL, DML, DQL statements. + # @param validate_only [::Boolean] + # Optional. If set, validates the sql statement by performing + # syntax and semantic validation and doesn't execute the query. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new + # + # # Call the execute_sql method. + # result = client.execute_sql request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse. + # 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::AlloyDB::V1beta::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 + call_metadata = @config.rpcs.execute_sql.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.execute_sql.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.execute_sql.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.execute_sql request, 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 Backups in a given project and location. + # + # @overload list_backups(request, options = nil) + # Pass arguments to `list_backups` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: 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. Parent value for ListBackupsRequest + # @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::AlloyDB::V1beta::Backup>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Backup>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_admin_stub.list_backups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_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 + + ## + # Gets details of a single Backup. + # + # @overload get_backup(request, options = nil) + # Pass arguments to `get_backup` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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 resource + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Backup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetBackupRequest.new + # + # # Call the get_backup method. + # result = client.get_backup request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_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 + + ## + # Creates a new Backup in a given project and location. + # + # @overload create_backup(request, options = nil) + # Pass arguments to `create_backup` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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, request_id: nil, validate_only: 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. Value for parent. + # @param backup_id [::String] + # Required. ID of the requesting object. + # @param backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute 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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_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 + + ## + # Updates the parameters of a single Backup. + # + # @overload update_backup(request, options = nil) + # Pass arguments to `update_backup` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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(update_mask: nil, backup: nil, request_id: nil, validate_only: nil, allow_missing: 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Backup 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 backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @param allow_missing [::Boolean] + # Optional. If set to true, update succeeds even if instance is not found. In + # that case, a new backup is created and `update_mask` is ignored. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new + # + # # Call the update_backup method. + # result = client.update_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 update_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_admin_stub.update_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 + + ## + # Deletes a single Backup. + # + # @overload delete_backup(request, options = nil) + # Pass arguments to `delete_backup` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_backup(name: nil, request_id: nil, validate_only: nil, etag: 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 resource. For the required format, see the comment on + # the Backup.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @param etag [::String] + # Optional. The current etag of the Backup. + # If an etag is provided and does not match the current etag of the Backup, + # deletion will be blocked and an ABORTED error will be returned. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new + # + # # Call the delete_backup method. + # result = client.delete_backup request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_backup request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_admin_stub.delete_backup request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists SupportedDatabaseFlags for a given project and location. + # + # @overload list_supported_database_flags(request, options = nil) + # Pass arguments to `list_supported_database_flags` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_supported_database_flags(parent: nil, page_size: nil, page_token: nil, scope: nil) + # Pass arguments to `list_supported_database_flags` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. The required format is: + # * projects/\\{project}/locations/\\{location} + # + # Regardless of the parent specified here, as long it is contains a valid + # project and location, the service will return a static list of supported + # flags resources. Note that we do not yet support region-specific + # flags. + # @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 scope [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::Scope] + # Optional. The scope for which supported flags are requested. If not + # specified, default is DATABASE. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new + # + # # Call the list_supported_database_flags method. + # result = client.list_supported_database_flags request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag. + # p item + # end + # + def list_supported_database_flags request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_supported_database_flags.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_supported_database_flags.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_supported_database_flags.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.list_supported_database_flags request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, "supported_database_flags", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Generate a client certificate signed by a Cluster CA. + # The sole purpose of this endpoint is to support AlloyDB connectors and the + # Auth Proxy client. The endpoint's behavior is subject to change without + # notice, so do not rely on its behavior remaining constant. Future changes + # will not break AlloyDB connectors or the Auth Proxy client. + # + # @overload generate_client_certificate(request, options = nil) + # Pass arguments to `generate_client_certificate` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil, public_key: nil, use_metadata_exchange: nil) + # Pass arguments to `generate_client_certificate` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. The required format is: + # * projects/\\{project}/locations/\\{location}/clusters/\\{cluster} + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param pem_csr [::String] + # Optional. A pem-encoded X.509 certificate signing request (CSR). It is + # recommended to use public_key instead. + # @param cert_duration [::Google::Protobuf::Duration, ::Hash] + # Optional. An optional hint to the endpoint to generate the client + # certificate with the requested duration. The duration can be from 1 hour to + # 24 hours. The endpoint may or may not honor the hint. If the hint is left + # unspecified or is not honored, then the endpoint will pick an appropriate + # default duration. + # @param public_key [::String] + # Optional. The public key from the client. + # @param use_metadata_exchange [::Boolean] + # Optional. An optional hint to the endpoint to generate a client certificate + # that can be used by AlloyDB connectors to exchange additional metadata with + # the server after TLS handshake. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new + # + # # Call the generate_client_certificate method. + # result = client.generate_client_certificate request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse. + # p result + # + def generate_client_certificate request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest + + # Converts hash and nil to an 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_client_certificate.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_client_certificate.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_client_certificate.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.generate_client_certificate request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get instance metadata used for a connection. + # + # @overload get_connection_info(request, options = nil) + # Pass arguments to `get_connection_info` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_connection_info(parent: nil, request_id: nil) + # Pass arguments to `get_connection_info` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The name of the parent resource. The required format is: + # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance} + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate 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::AlloyDB::V1beta::ConnectionInfo] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new + # + # # Call the get_connection_info method. + # result = client.get_connection_info request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::ConnectionInfo. + # p result + # + def get_connection_info request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_connection_info.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_connection_info.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_connection_info.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.get_connection_info request, 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 Users in a given project and location. + # + # @overload list_users(request, options = nil) + # Pass arguments to `list_users` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListUsersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_users` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 ListUsersRequest + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. Filtering results + # @param order_by [::String] + # Optional. Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::User>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::User>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::ListUsersRequest.new + # + # # Call the list_users method. + # result = client.list_users request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::User. + # p item + # end + # + def list_users request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_users.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_users.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_users.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.list_users request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_users, "users", request, result, options + 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 User. + # + # @overload get_user(request, options = nil) + # Pass arguments to `get_user` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::GetUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::GetUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_user(name: nil) + # Pass arguments to `get_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the User.name field. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::GetUserRequest.new + # + # # Call the get_user method. + # result = client.get_user request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + # p result + # + def get_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_user.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.get_user request, 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 User in a given project, location, and cluster. + # + # @overload create_user(request, options = nil) + # Pass arguments to `create_user` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify 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 user_id [::String] + # Required. ID of the requesting object. + # @param user [::Google::Cloud::AlloyDB::V1beta::User, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new + # + # # Call the create_user method. + # result = client.create_user request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + # p result + # + def create_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_user.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.create_user request, 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 User. + # + # @overload update_user(request, options = nil) + # Pass arguments to `update_user` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # User 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 user [::Google::Cloud::AlloyDB::V1beta::User, ::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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @param allow_missing [::Boolean] + # Optional. Allow missing fields in the update mask. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new + # + # # Call the update_user method. + # result = client.update_user request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + # p result + # + def update_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_user.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.update_user request, 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 User. + # + # @overload delete_user(request, options = nil) + # Pass arguments to `delete_user` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_user(name: nil, request_id: nil, validate_only: nil) + # Pass arguments to `delete_user` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the resource. For the required format, see the + # comment on the User.name field. + # @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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @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/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new + # + # # Call the delete_user method. + # result = client.delete_user request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_user request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_user.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_user.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_user.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_admin_stub.delete_user request, 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 Databases in a given project and location. + # + # @overload list_databases(request, options = nil) + # Pass arguments to `list_databases` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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, filter: 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. Parent value for ListDatabasesRequest. + # @param page_size [::Integer] + # Optional. The maximum number of databases to return. The service may return + # fewer than this value. If unspecified, 2000 is the default page_size. The + # max value of page_size will be 4000, values above max will be coerced to + # max. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDatabases` call. + # This should be provided to retrieve the subsequent page. + # This field is currently not supported, its value will be ignored if passed. + # @param filter [::String] + # Optional. Filtering results. + # This field is currently not supported, its value will be ignored if passed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Database>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Database>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_admin_stub.list_databases request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_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 Database in a given project, location, and cluster. + # + # @overload create_database(request, options = nil) + # Pass arguments to `create_database` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::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, database_id: nil, database: 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. Value for parent. + # @param database_id [::String] + # Required. ID of the requesting object. + # @param database [::Google::Cloud::AlloyDB::V1beta::Database, ::Hash] + # Required. The resource being created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Database] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Database] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new + # + # # Call the create_database method. + # result = client.create_database request + # + # # The returned object is of type Google::Cloud::AlloyDB::V1beta::Database. + # p result + # + def create_database request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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 + + @alloy_db_admin_stub.create_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 + + ## + # Configuration class for the AlloyDBAdmin REST API. + # + # This class represents the configuration for AlloyDBAdmin REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "alloydb.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 AlloyDBAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `export_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :export_cluster + ## + # RPC-specific configuration for `import_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :import_cluster + ## + # RPC-specific configuration for `upgrade_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `promote_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :promote_cluster + ## + # RPC-specific configuration for `switchover_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :switchover_cluster + ## + # RPC-specific configuration for `restore_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_cluster + ## + # RPC-specific configuration for `create_secondary_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secondary_cluster + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_instance + ## + # RPC-specific configuration for `create_secondary_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secondary_instance + ## + # RPC-specific configuration for `batch_create_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_instances + ## + # 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 `failover_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :failover_instance + ## + # RPC-specific configuration for `inject_fault` + # @return [::Gapic::Config::Method] + # + attr_reader :inject_fault + ## + # RPC-specific configuration for `restart_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :restart_instance + ## + # RPC-specific configuration for `execute_sql` + # @return [::Gapic::Config::Method] + # + attr_reader :execute_sql + ## + # RPC-specific configuration for `list_backups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_backups + ## + # RPC-specific configuration for `get_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :get_backup + ## + # RPC-specific configuration for `create_backup` + # @return [::Gapic::Config::Method] + # + attr_reader :create_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_supported_database_flags` + # @return [::Gapic::Config::Method] + # + attr_reader :list_supported_database_flags + ## + # RPC-specific configuration for `generate_client_certificate` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_client_certificate + ## + # RPC-specific configuration for `get_connection_info` + # @return [::Gapic::Config::Method] + # + attr_reader :get_connection_info + ## + # RPC-specific configuration for `list_users` + # @return [::Gapic::Config::Method] + # + attr_reader :list_users + ## + # RPC-specific configuration for `get_user` + # @return [::Gapic::Config::Method] + # + attr_reader :get_user + ## + # RPC-specific configuration for `create_user` + # @return [::Gapic::Config::Method] + # + attr_reader :create_user + ## + # RPC-specific configuration for `update_user` + # @return [::Gapic::Config::Method] + # + attr_reader :update_user + ## + # RPC-specific configuration for `delete_user` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_user + ## + # 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 + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + export_cluster_config = parent_rpcs.export_cluster if parent_rpcs.respond_to? :export_cluster + @export_cluster = ::Gapic::Config::Method.new export_cluster_config + import_cluster_config = parent_rpcs.import_cluster if parent_rpcs.respond_to? :import_cluster + @import_cluster = ::Gapic::Config::Method.new import_cluster_config + upgrade_cluster_config = parent_rpcs.upgrade_cluster if parent_rpcs.respond_to? :upgrade_cluster + @upgrade_cluster = ::Gapic::Config::Method.new upgrade_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster + @promote_cluster = ::Gapic::Config::Method.new promote_cluster_config + switchover_cluster_config = parent_rpcs.switchover_cluster if parent_rpcs.respond_to? :switchover_cluster + @switchover_cluster = ::Gapic::Config::Method.new switchover_cluster_config + restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster + @restore_cluster = ::Gapic::Config::Method.new restore_cluster_config + create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster + @create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance + @create_instance = ::Gapic::Config::Method.new create_instance_config + create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance + @create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config + batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances + @batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_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 + failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance + @failover_instance = ::Gapic::Config::Method.new failover_instance_config + inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault + @inject_fault = ::Gapic::Config::Method.new inject_fault_config + restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance + @restart_instance = ::Gapic::Config::Method.new restart_instance_config + execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql + @execute_sql = ::Gapic::Config::Method.new execute_sql_config + list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups + @list_backups = ::Gapic::Config::Method.new list_backups_config + get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup + @get_backup = ::Gapic::Config::Method.new get_backup_config + create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup + @create_backup = ::Gapic::Config::Method.new create_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_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags + @list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config + generate_client_certificate_config = parent_rpcs.generate_client_certificate if parent_rpcs.respond_to? :generate_client_certificate + @generate_client_certificate = ::Gapic::Config::Method.new generate_client_certificate_config + get_connection_info_config = parent_rpcs.get_connection_info if parent_rpcs.respond_to? :get_connection_info + @get_connection_info = ::Gapic::Config::Method.new get_connection_info_config + list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users + @list_users = ::Gapic::Config::Method.new list_users_config + get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user + @get_user = ::Gapic::Config::Method.new get_user_config + create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user + @create_user = ::Gapic::Config::Method.new create_user_config + update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user + @update_user = ::Gapic::Config::Method.new update_user_config + delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user + @delete_user = ::Gapic::Config::Method.new delete_user_config + 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 + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb new file mode 100644 index 000000000000..bacf81ac9028 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb @@ -0,0 +1,924 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBAdmin + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AlloyDBAdmin 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 AlloyDBAdmin 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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "alloydb.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb new file mode 100644 index 000000000000..4acdf9507722 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb @@ -0,0 +1,2422 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/alloydb/v1beta/service_pb" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBAdmin + module Rest + ## + # REST service stub for the AlloyDBAdmin service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ListClustersResponse] + # A result object deserialized from the server's reply + def list_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::ListClustersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] + # A result object deserialized from the server's reply + def get_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::Cluster.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the export_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def export_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "export_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the import_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def import_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "import_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the upgrade_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def upgrade_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "upgrade_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the promote_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def promote_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_promote_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "promote_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the switchover_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def switchover_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_switchover_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "switchover_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the restore_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "restore_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_secondary_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_secondary_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_secondary_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_secondary_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_instances REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::ListInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::ListInstancesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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 create_secondary_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_secondary_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_secondary_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_secondary_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 batch_create_instances REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_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: "batch_create_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_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::AlloyDB::V1beta::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::AlloyDB::V1beta::DeleteInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the failover_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def failover_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_failover_instance_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "failover_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the inject_fault REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def inject_fault request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_inject_fault_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "inject_fault", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the restart_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def restart_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restart_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: "restart_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 execute_sql REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] + # A result object deserialized from the server's reply + def execute_sql request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_execute_sql_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "execute_sql", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse.decode_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::AlloyDB::V1beta::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::AlloyDB::V1beta::ListBackupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_backup REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Backup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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 create_backup REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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 update_backup REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # 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::Longrunning::Operation.decode_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::AlloyDB::V1beta::DeleteBackupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_backup request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_backup", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_supported_database_flags REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse] + # A result object deserialized from the server's reply + def list_supported_database_flags request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_supported_database_flags_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_supported_database_flags", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse.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_client_certificate REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] + # A result object deserialized from the server's reply + def generate_client_certificate request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_client_certificate_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "generate_client_certificate", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_connection_info REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo] + # A result object deserialized from the server's reply + def get_connection_info request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_connection_info_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_connection_info", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::ConnectionInfo.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_users REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListUsersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::ListUsersResponse] + # A result object deserialized from the server's reply + def list_users request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_users_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_users", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::ListUsersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_user REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetUserRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # A result object deserialized from the server's reply + def get_user request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_user_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_user", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::User.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_user REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # A result object deserialized from the server's reply + def create_user request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_user_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_user", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::User.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_user REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # A result object deserialized from the server's reply + def update_user request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_user_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_user", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::AlloyDB::V1beta::User.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_user REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_user request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_user_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_user", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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_databases REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::ListDatabasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::Cloud::AlloyDB::V1beta::Database] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::AlloyDB::V1beta::Database] + # 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::Cloud::AlloyDB::V1beta::Database.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/clusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/clusters", + body: "cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{cluster.name}", + body: "cluster", + matches: [ + ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_import_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:import", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upgrade_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upgrade_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{name}:upgrade", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the promote_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_promote_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:promote", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the switchover_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_switchover_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:switchover", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/clusters:restore", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_secondary_cluster REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_secondary_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/clusters:createsecondary", + body: "cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instances REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/instances", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/instances", + body: "instance", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_secondary_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_secondary_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/instances:createsecondary", + body: "instance", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_instances REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest] + # 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_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/instances:batchCreate", + body: "requests", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{instance.name}", + body: "instance", + matches: [ + ["instance.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the failover_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_failover_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:failover", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the inject_fault REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_inject_fault_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:injectFault", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restart_instance REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_restart_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:restart", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the execute_sql REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_execute_sql_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{instance}:executeSql", + body: "*", + matches: [ + ["instance", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_backups REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/backups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_backup REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_backup REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/backups", + body: "backup", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_backup REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{backup.name}", + body: "backup", + matches: [ + ["backup.name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_backup REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_supported_database_flags REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_supported_database_flags_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/supportedDatabaseFlags", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_client_certificate REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest] + # 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_client_certificate_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}:generateClientCertificate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_connection_info REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_connection_info_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/connectionInfo", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_users REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_users_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/users", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_user REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetUserRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_user_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/users/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_user REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_user_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/users", + body: "user", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_user REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_user_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{user.name}", + body: "user", + matches: [ + ["user.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/users/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_user REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_user_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/users/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_databases REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/databases", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_database REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/databases", + body: "database", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin.rb new file mode 100644 index 000000000000..ac62193e3fa3 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/alloy_db/v1beta/version" + +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" + +module Google + module Cloud + module AlloyDB + module V1beta + ## + # Service for interactions with CloudSQL. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new + # + module AlloyDBCloudSQLAdmin + end + end + end + end +end + +helper_path = ::File.join __dir__, "alloy_db_cloud_sql_admin", "helpers.rb" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client.rb new file mode 100644 index 000000000000..7346187f2baf --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client.rb @@ -0,0 +1,536 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/alloydb/v1beta/csql_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBCloudSQLAdmin + ## + # Client for the AlloyDBCloudSQLAdmin service. + # + # Service for interactions with CloudSQL. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :alloy_db_cloud_sql_admin_stub + + ## + # Configure the AlloyDBCloudSQLAdmin Client class. + # + # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AlloyDBCloudSQLAdmin clients + # ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AlloyDB", "V1beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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 AlloyDBCloudSQLAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @alloy_db_cloud_sql_admin_stub.universe_domain + end + + ## + # Create a new AlloyDBCloudSQLAdmin client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AlloyDBCloudSQLAdmin 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/alloydb/v1beta/csql_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 + + @alloy_db_cloud_sql_admin_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::AlloyDB::V1beta::AlloyDBCSQLAdmin::Stub, + credentials: credentials, + endpoint: @config.endpoint, + 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 + ) + + @alloy_db_cloud_sql_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 + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_cloud_sql_admin_stub.endpoint + config.universe_domain = @alloy_db_cloud_sql_admin_stub.universe_domain + config.logger = @alloy_db_cloud_sql_admin_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_cloud_sql_admin_stub.endpoint + config.universe_domain = @alloy_db_cloud_sql_admin_stub.universe_domain + config.logger = @alloy_db_cloud_sql_admin_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @alloy_db_cloud_sql_admin_stub.logger + end + + # Service calls + + ## + # Restores an AlloyDB cluster from a CloudSQL resource. + # + # @overload restore_from_cloud_sql(request, options = nil) + # Pass arguments to `restore_from_cloud_sql` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_from_cloud_sql(cloudsql_backup_run_source: nil, parent: nil, cluster_id: nil, cluster: nil) + # Pass arguments to `restore_from_cloud_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 cloudsql_backup_run_source [::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource, ::Hash] + # Cluster created from CloudSQL backup run. + # @param parent [::String] + # Required. The location of the new cluster. For the required format, see the + # comment on Cluster.name field. + # @param cluster_id [::String] + # Required. ID of the requesting object. + # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash] + # Required. The resource being created + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new + # + # # Call the restore_from_cloud_sql method. + # result = client.restore_from_cloud_sql request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_from_cloud_sql request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest + + # Converts hash and nil to 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_from_cloud_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_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_from_cloud_sql.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_from_cloud_sql.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_cloud_sql_admin_stub.call_rpc :restore_from_cloud_sql, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, 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 AlloyDBCloudSQLAdmin API. + # + # This class represents the configuration for AlloyDBCloudSQLAdmin, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # restore_from_cloud_sql to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.restore_from_cloud_sql.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.restore_from_cloud_sql.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate 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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "alloydb.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AlloyDBCloudSQLAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `restore_from_cloud_sql` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_from_cloud_sql + + # @private + def initialize parent_rpcs = nil + restore_from_cloud_sql_config = parent_rpcs.restore_from_cloud_sql if parent_rpcs.respond_to? :restore_from_cloud_sql + @restore_from_cloud_sql = ::Gapic::Config::Method.new restore_from_cloud_sql_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials.rb new file mode 100644 index 000000000000..cd77a84284ba --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBCloudSQLAdmin + # Credentials for the AlloyDBCloudSQLAdmin 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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations.rb new file mode 100644 index 000000000000..4204bdb1646d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations.rb @@ -0,0 +1,841 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBCloudSQLAdmin + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AlloyDBCloudSQLAdmin 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 AlloyDBCloudSQLAdmin 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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_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::AlloyDB::V1beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_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::AlloyDB::V1beta::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 = "alloydb.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for 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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths.rb new file mode 100644 index 000000000000..d4657376e489 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBCloudSQLAdmin + # Path helper methods for the AlloyDBCloudSQLAdmin API. + module Paths + ## + # Create a fully-qualified Backup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/backups/{backup}` + # + # @param project [String] + # @param location [String] + # @param backup [String] + # + # @return [::String] + def backup_path project:, location:, backup: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/backups/#{backup}" + end + + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified CryptoKeyVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # @param crypto_key_version [String] + # + # @return [::String] + def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest.rb new file mode 100644 index 000000000000..815a45f6c49b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/alloy_db/v1beta/version" +require "google/cloud/alloy_db/v1beta/bindings_override" + +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client" + +module Google + module Cloud + module AlloyDB + module V1beta + ## + # Service for interactions with CloudSQL. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new + # + module AlloyDBCloudSQLAdmin + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client.rb new file mode 100644 index 000000000000..f13328ef7d7a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client.rb @@ -0,0 +1,494 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/alloydb/v1beta/csql_service_pb" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBCloudSQLAdmin + module Rest + ## + # REST client for the AlloyDBCloudSQLAdmin service. + # + # Service for interactions with CloudSQL. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :alloy_db_cloud_sql_admin_stub + + ## + # Configure the AlloyDBCloudSQLAdmin Client class. + # + # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AlloyDBCloudSQLAdmin clients + # ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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", "AlloyDB", "V1beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get 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 AlloyDBCloudSQLAdmin Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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 + @alloy_db_cloud_sql_admin_stub.universe_domain + end + + ## + # Create a new AlloyDBCloudSQLAdmin REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AlloyDBCloudSQLAdmin 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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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 + + @alloy_db_cloud_sql_admin_stub = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @alloy_db_cloud_sql_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 + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_cloud_sql_admin_stub.endpoint + config.universe_domain = @alloy_db_cloud_sql_admin_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @alloy_db_cloud_sql_admin_stub.logger if config.respond_to? :logger= + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @alloy_db_cloud_sql_admin_stub.endpoint + config.universe_domain = @alloy_db_cloud_sql_admin_stub.universe_domain + config.logger = @alloy_db_cloud_sql_admin_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @alloy_db_cloud_sql_admin_stub.logger + end + + # Service calls + + ## + # Restores an AlloyDB cluster from a CloudSQL resource. + # + # @overload restore_from_cloud_sql(request, options = nil) + # Pass arguments to `restore_from_cloud_sql` via a request object, either of type + # {::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_from_cloud_sql(cloudsql_backup_run_source: nil, parent: nil, cluster_id: nil, cluster: nil) + # Pass arguments to `restore_from_cloud_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 cloudsql_backup_run_source [::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource, ::Hash] + # Cluster created from CloudSQL backup run. + # @param parent [::String] + # Required. The location of the new cluster. For the required format, see the + # comment on Cluster.name field. + # @param cluster_id [::String] + # Required. ID of the requesting object. + # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash] + # Required. The resource being created + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/alloy_db/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new + # + # # Call the restore_from_cloud_sql method. + # result = client.restore_from_cloud_sql request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how 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_from_cloud_sql request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest + + # Converts hash and nil to an 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_from_cloud_sql.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_from_cloud_sql.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_from_cloud_sql.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @alloy_db_cloud_sql_admin_stub.restore_from_cloud_sql request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 AlloyDBCloudSQLAdmin REST API. + # + # This class represents the configuration for AlloyDBCloudSQLAdmin REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # restore_from_cloud_sql to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.restore_from_cloud_sql.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.restore_from_cloud_sql.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "alloydb.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::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 AlloyDBCloudSQLAdmin API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `restore_from_cloud_sql` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_from_cloud_sql + + # @private + def initialize parent_rpcs = nil + restore_from_cloud_sql_config = parent_rpcs.restore_from_cloud_sql if parent_rpcs.respond_to? :restore_from_cloud_sql + @restore_from_cloud_sql = ::Gapic::Config::Method.new restore_from_cloud_sql_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations.rb new file mode 100644 index 000000000000..2419ff410cb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations.rb @@ -0,0 +1,924 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBCloudSQLAdmin + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AlloyDBCloudSQLAdmin 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 AlloyDBCloudSQLAdmin 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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 = "alloydb.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub.rb new file mode 100644 index 000000000000..c20a7f148c39 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/alloydb/v1beta/csql_service_pb" + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBCloudSQLAdmin + module Rest + ## + # REST service stub for the AlloyDBCloudSQLAdmin 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 restore_from_cloud_sql REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @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_from_cloud_sql request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_from_cloud_sql_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_from_cloud_sql", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + 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 restore_from_cloud_sql REST call + # + # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest] + # 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_from_cloud_sql_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/clusters:restoreFromCloudSQL", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/bindings_override.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/bindings_override.rb new file mode 100644 index 000000000000..00d276bf4d70 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" + +module Google + module Cloud + module AlloyDB + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/alloy_db/v1beta/rest" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + module V1beta + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "AlloyDB"] + parent_config = while namespace.any? + parent_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: "/v1beta/{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: "/v1beta/{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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/rest.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/rest.rb new file mode 100644 index 000000000000..21641994a38a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" +require "google/cloud/alloy_db/v1beta/bindings_override" +require "google/cloud/alloy_db/v1beta/version" + +module Google + module Cloud + module AlloyDB + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/alloy_db/v1beta/rest" + # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new + # + module V1beta + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/version.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/version.rb new file mode 100644 index 000000000000..1054128cc3b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb new file mode 100644 index 000000000000..9c0f11daadbb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/alloydb/v1beta/csql_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n0google/cloud/alloydb/v1beta/csql_resources.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1fgoogle/api/field_behavior.proto\"`\n\x17\x43loudSQLBackupRunSource\x12\x0f\n\x07project\x18\x01 \x01(\t\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rbackup_run_id\x18\x03 \x01(\x03\x42\x03\xe0\x41\x02\x42\xcf\x01\n\x1f\x63om.google.cloud.alloydb.v1betaB\x12\x43sqlResourcesProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1betab\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AlloyDB + module V1beta + CloudSQLBackupRunSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.CloudSQLBackupRunSource").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_pb.rb new file mode 100644 index 000000000000..71936a56ae16 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_pb.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/alloydb/v1beta/csql_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/alloydb/v1beta/csql_resources_pb' +require 'google/cloud/alloydb/v1beta/resources_pb' +require 'google/cloud/alloydb/v1beta/service_pb' +require 'google/longrunning/operations_pb' + + +descriptor_data = "\n.google/cloud/alloydb/v1beta/csql_service.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/alloydb/v1beta/csql_resources.proto\x1a+google/cloud/alloydb/v1beta/resources.proto\x1a)google/cloud/alloydb/v1beta/service.proto\x1a#google/longrunning/operations.proto\"\x8f\x02\n\x1aRestoreFromCloudSQLRequest\x12Z\n\x1a\x63loudsql_backup_run_source\x18\x65 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.CloudSQLBackupRunSourceH\x00\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x07\x63luster\x18\x03 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x42\x08\n\x06source2\xd3\x02\n\x10\x41lloyDBCSQLAdmin\x12\xf2\x01\n\x13RestoreFromCloudSQL\x12\x37.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x11parent,cluster_id\x82\xd3\xe4\x93\x02I\"D/v1beta/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL:\x01*\x1aJ\xca\x41\x16\x61lloydb.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcd\x01\n\x1f\x63om.google.cloud.alloydb.v1betaB\x10\x43SQLServiceProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1betab\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.alloydb.v1beta.CloudSQLBackupRunSource", "google/cloud/alloydb/v1beta/csql_resources.proto"], + ["google.cloud.alloydb.v1beta.Cluster", "google/cloud/alloydb/v1beta/resources.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AlloyDB + module V1beta + RestoreFromCloudSQLRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_services_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_services_pb.rb new file mode 100644 index 000000000000..1453fecf2503 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_services_pb.rb @@ -0,0 +1,45 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/alloydb/v1beta/csql_service.proto for package 'Google.Cloud.AlloyDB.V1beta' +# 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/alloydb/v1beta/csql_service_pb' + +module Google + module Cloud + module AlloyDB + module V1beta + module AlloyDBCSQLAdmin + # Service for interactions with CloudSQL. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin' + + # Restores an AlloyDB cluster from a CloudSQL resource. + rpc :RestoreFromCloudSQL, ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/data_model_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/data_model_pb.rb new file mode 100644 index 000000000000..71f4d415ec17 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/data_model_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/alloydb/v1beta/data_model.proto + +require 'google/protobuf' + + +descriptor_data = "\n,google/cloud/alloydb/v1beta/data_model.proto\x12\x1bgoogle.cloud.alloydb.v1beta\"\x83\x01\n\tSqlResult\x12=\n\x07\x63olumns\x18\x01 \x03(\x0b\x32,.google.cloud.alloydb.v1beta.SqlResultColumn\x12\x37\n\x04rows\x18\x02 \x03(\x0b\x32).google.cloud.alloydb.v1beta.SqlResultRow\"-\n\x0fSqlResultColumn\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\"K\n\x0cSqlResultRow\x12;\n\x06values\x18\x01 \x03(\x0b\x32+.google.cloud.alloydb.v1beta.SqlResultValue\"V\n\x0eSqlResultValue\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x17\n\nnull_value\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x08\n\x06_valueB\r\n\x0b_null_valueB\xcb\x01\n\x1f\x63om.google.cloud.alloydb.v1betaB\x0e\x44\x61taModelProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1betab\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AlloyDB + module V1beta + SqlResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SqlResult").msgclass + SqlResultColumn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SqlResultColumn").msgclass + SqlResultRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SqlResultRow").msgclass + SqlResultValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SqlResultValue").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/gemini_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/gemini_pb.rb new file mode 100644 index 000000000000..66efa930c5a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/gemini_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/alloydb/v1beta/gemini.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n(google/cloud/alloydb/v1beta/gemini.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1fgoogle/api/field_behavior.proto\".\n\x13GeminiClusterConfig\x12\x17\n\x08\x65ntitled\x18\x01 \x01(\x08\x42\x05\x18\x01\xe0\x41\x03\"/\n\x14GeminiInstanceConfig\x12\x17\n\x08\x65ntitled\x18\x01 \x01(\x08\x42\x05\x18\x01\xe0\x41\x03\"b\n\x11GCAInstanceConfig\x12M\n\x0fgca_entitlement\x18\x01 \x01(\x0e\x32/.google.cloud.alloydb.v1beta.GCAEntitlementTypeB\x03\xe0\x41\x03*L\n\x12GCAEntitlementType\x12$\n GCA_ENTITLEMENT_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGCA_STANDARD\x10\x01\x42\xc8\x01\n\x1f\x63om.google.cloud.alloydb.v1betaB\x0bGeminiProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1betab\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AlloyDB + module V1beta + GeminiClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.GeminiClusterConfig").msgclass + GeminiInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.GeminiInstanceConfig").msgclass + GCAInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.GCAInstanceConfig").msgclass + GCAEntitlementType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.GCAEntitlementType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb new file mode 100644 index 000000000000..7203024f9417 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/alloydb/v1beta/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/alloydb/v1beta/csql_resources_pb' +require 'google/cloud/alloydb/v1beta/gemini_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/type/date_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' + + +descriptor_data = "\n+google/cloud/alloydb/v1beta/resources.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/alloydb/v1beta/csql_resources.proto\x1a(google/cloud/alloydb/v1beta/gemini.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x16google/type/date.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\".\n\x0cUserPassword\x12\x0c\n\x04user\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\xe7\x01\n\x0fMigrationSource\x12\x16\n\thost_port\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0creference_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x0bsource_type\x18\x03 \x01(\x0e\x32@.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceTypeB\x03\xe0\x41\x03\"E\n\x13MigrationSourceType\x12%\n!MIGRATION_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x44MS\x10\x01\"P\n\x10\x45ncryptionConfig\x12<\n\x0ckms_key_name\x18\x01 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x8a\x02\n\x0e\x45ncryptionInfo\x12N\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\\\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\"\x86\x03\n\tSslConfig\x12\x45\n\x08ssl_mode\x18\x01 \x01(\x0e\x32..google.cloud.alloydb.v1beta.SslConfig.SslModeB\x03\xe0\x41\x01\x12G\n\tca_source\x18\x02 \x01(\x0e\x32/.google.cloud.alloydb.v1beta.SslConfig.CaSourceB\x03\xe0\x41\x01\"\xaa\x01\n\x07SslMode\x12\x18\n\x14SSL_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x0eSSL_MODE_ALLOW\x10\x01\x1a\x02\x08\x01\x12\x18\n\x10SSL_MODE_REQUIRE\x10\x02\x1a\x02\x08\x01\x12\x1a\n\x12SSL_MODE_VERIFY_CA\x10\x03\x1a\x02\x08\x01\x12#\n\x1f\x41LLOW_UNENCRYPTED_AND_ENCRYPTED\x10\x04\x12\x12\n\x0e\x45NCRYPTED_ONLY\x10\x05\"<\n\x08\x43\x61Source\x12\x19\n\x15\x43\x41_SOURCE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43\x41_SOURCE_MANAGED\x10\x01\"\xf9\x06\n\x15\x41utomatedBackupPolicy\x12\\\n\x0fweekly_schedule\x18\x02 \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleH\x00\x12\x65\n\x14time_based_retention\x18\x04 \x01(\x0b\x32\x45.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionH\x01\x12m\n\x18quantity_based_retention\x18\x05 \x01(\x0b\x32I.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionH\x01\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x02\x88\x01\x01\x12\x30\n\rbackup_window\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12M\n\x11\x65ncryption_config\x18\x08 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12\x10\n\x08location\x18\x06 \x01(\t\x12N\n\x06labels\x18\x07 \x03(\x0b\x32>.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.LabelsEntry\x1ak\n\x0eWeeklySchedule\x12+\n\x0bstart_times\x18\x01 \x03(\x0b\x32\x16.google.type.TimeOfDay\x12,\n\x0c\x64\x61ys_of_week\x18\x02 \x03(\x0e\x32\x16.google.type.DayOfWeek\x1aI\n\x12TimeBasedRetention\x12\x33\n\x10retention_period\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\'\n\x16QuantityBasedRetention\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\n\n\x08scheduleB\x0b\n\tretentionB\n\n\x08_enabled\"\xa2\x01\n\x16\x43ontinuousBackupConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x14recovery_window_days\x18\x04 \x01(\x05\x12H\n\x11\x65ncryption_config\x18\x03 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\n\n\x08_enabled\"\x8a\x02\n\x14\x43ontinuousBackupInfo\x12I\n\x0f\x65ncryption_info\x18\x01 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12\x35\n\x0c\x65nabled_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12-\n\x08schedule\x18\x03 \x03(\x0e\x32\x16.google.type.DayOfWeekB\x03\xe0\x41\x03\x12\x41\n\x18\x65\x61rliest_restorable_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\x0c\x42\x61\x63kupSource\x12\x17\n\nbackup_uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12:\n\x0b\x62\x61\x63kup_name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61lloydb.googleapis.com/Backup\"f\n\x16\x43ontinuousBackupSource\x12\x14\n\x07\x63luster\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\rpoint_in_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"\xde\x03\n\x17MaintenanceUpdatePolicy\x12\x63\n\x13maintenance_windows\x18\x01 \x03(\x0b\x32\x46.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow\x12l\n\x18\x64\x65ny_maintenance_periods\x18\x02 \x03(\x0b\x32J.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod\x1a\x64\n\x11MaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\x1a\x89\x01\n\x15\x44\x65nyMaintenancePeriod\x12%\n\nstart_date\x18\x01 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12$\n\x04time\x18\x03 \x01(\x0b\x32\x16.google.type.TimeOfDay\"J\n\x13MaintenanceSchedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xf6\x1a\n\x07\x43luster\x12G\n\rbackup_source\x18\x0f \x01(\x0b\x32).google.cloud.alloydb.v1beta.BackupSourceB\x03\xe0\x41\x03H\x00\x12M\n\x10migration_source\x18\x10 \x01(\x0b\x32,.google.cloud.alloydb.v1beta.MigrationSourceB\x03\xe0\x41\x03H\x00\x12_\n\x1a\x63loudsql_backup_run_source\x18* \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.CloudSQLBackupRunSourceB\x03\xe0\x41\x03H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x06labels\x18\x07 \x03(\x0b\x32\x30.google.cloud.alloydb.v1beta.Cluster.LabelsEntry\x12>\n\x05state\x18\x08 \x01(\x0e\x32*.google.cloud.alloydb.v1beta.Cluster.StateB\x03\xe0\x41\x03\x12K\n\x0c\x63luster_type\x18\x18 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.Cluster.ClusterTypeB\x03\xe0\x41\x03\x12K\n\x10\x64\x61tabase_version\x18\t \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\x03\xe0\x41\x01\x12O\n\x0enetwork_config\x18\x1d \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.NetworkConfigB\x03\xe0\x41\x01\x12\x39\n\x07network\x18\n \x01(\tB(\x18\x01\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t\x12J\n\x0b\x61nnotations\x18\x0c \x03(\x0b\x32\x35.google.cloud.alloydb.v1beta.Cluster.AnnotationsEntry\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12\x44\n\x0cinitial_user\x18\x0e \x01(\x0b\x32).google.cloud.alloydb.v1beta.UserPasswordB\x03\xe0\x41\x04\x12S\n\x17\x61utomated_backup_policy\x18\x11 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.AutomatedBackupPolicy\x12>\n\nssl_config\x18\x12 \x01(\x0b\x32&.google.cloud.alloydb.v1beta.SslConfigB\x02\x18\x01\x12M\n\x11\x65ncryption_config\x18\x13 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12I\n\x0f\x65ncryption_info\x18\x14 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12Z\n\x18\x63ontinuous_backup_config\x18\x1b \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.ContinuousBackupConfigB\x03\xe0\x41\x01\x12V\n\x16\x63ontinuous_backup_info\x18\x1c \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.ContinuousBackupInfoB\x03\xe0\x41\x03\x12N\n\x10secondary_config\x18\x16 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig\x12O\n\x0eprimary_config\x18\x17 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x1e \x01(\x08\x42\x03\xe0\x41\x03\x12G\n\npsc_config\x18\x1f \x01(\x0b\x32..google.cloud.alloydb.v1beta.Cluster.PscConfigB\x03\xe0\x41\x01\x12\\\n\x19maintenance_update_policy\x18 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicyB\x03\xe0\x41\x01\x12S\n\x14maintenance_schedule\x18% \x01(\x0b\x32\x30.google.cloud.alloydb.v1beta.MaintenanceScheduleB\x03\xe0\x41\x03\x12N\n\rgemini_config\x18$ \x01(\x0b\x32\x30.google.cloud.alloydb.v1beta.GeminiClusterConfigB\x05\x18\x01\xe0\x41\x01\x12M\n\x11subscription_type\x18& \x01(\x0e\x32-.google.cloud.alloydb.v1beta.SubscriptionTypeB\x03\xe0\x41\x01\x12O\n\x0etrial_metadata\x18\' \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.TrialMetadataB\x03\xe0\x41\x03\x12G\n\x04tags\x18) \x03(\x0b\x32..google.cloud.alloydb.v1beta.Cluster.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x12\"\n\x15service_account_email\x18. \x01(\tB\x03\xe0\x41\x03\x1ai\n\rNetworkConfig\x12\x37\n\x07network\x18\x01 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x1f\n\x12\x61llocated_ip_range\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1aT\n\x0fSecondaryConfig\x12\x41\n\x14primary_cluster_name\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x1aX\n\rPrimaryConfig\x12G\n\x17secondary_cluster_names\x18\x01 \x03(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x1aP\n\tPscConfig\x12\x18\n\x0bpsc_enabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1cservice_owned_project_number\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x1a\xd3\x01\n\rTrialMetadata\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\x12\x30\n\x0cupgrade_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0egrace_end_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9c\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\t\n\x05\x45MPTY\x10\x03\x12\x0c\n\x08\x43REATING\x10\x04\x12\x0c\n\x08\x44\x45LETING\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x11\n\rBOOTSTRAPPING\x10\x07\x12\x0f\n\x0bMAINTENANCE\x10\x08\x12\r\n\tPROMOTING\x10\t\"G\n\x0b\x43lusterType\x12\x1c\n\x18\x43LUSTER_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02:u\xea\x41r\n\x1e\x61lloydb.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterR\x01\x01\x42\x08\n\x06source\"\xa2)\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x07 \x03(\x0b\x32\x31.google.cloud.alloydb.v1beta.Instance.LabelsEntry\x12?\n\x05state\x18\x08 \x01(\x0e\x32+.google.cloud.alloydb.v1beta.Instance.StateB\x03\xe0\x41\x03\x12N\n\rinstance_type\x18\t \x01(\x0e\x32\x32.google.cloud.alloydb.v1beta.Instance.InstanceTypeB\x03\xe0\x41\x02\x12K\n\x0emachine_config\x18\n \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.Instance.MachineConfig\x12Q\n\x11\x61vailability_type\x18\x0b \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.Instance.AvailabilityType\x12\x10\n\x08gce_zone\x18\x0c \x01(\t\x12P\n\x0e\x64\x61tabase_flags\x18\r \x03(\x0b\x32\x38.google.cloud.alloydb.v1beta.Instance.DatabaseFlagsEntry\x12\x46\n\rwritable_node\x18\x13 \x01(\x0b\x32*.google.cloud.alloydb.v1beta.Instance.NodeB\x03\xe0\x41\x03\x12>\n\x05nodes\x18\x14 \x03(\x0b\x32*.google.cloud.alloydb.v1beta.Instance.NodeB\x03\xe0\x41\x03\x12`\n\x15query_insights_config\x18\x15 \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig\x12_\n\x14observability_config\x18\x1a \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig\x12N\n\x10read_pool_config\x18\x0e \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig\x12\x17\n\nip_address\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12&\n\x11public_ip_address\x18\x1b \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x18\n\x0breconciling\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x11 \x01(\t\x12K\n\x0b\x61nnotations\x18\x12 \x03(\x0b\x32\x36.google.cloud.alloydb.v1beta.Instance.AnnotationsEntry\x12I\n\rupdate_policy\x18\x16 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Instance.UpdatePolicy\x12\x63\n\x18\x63lient_connection_config\x18\x17 \x01(\x0b\x32<.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfigB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03\x12Y\n\x13psc_instance_config\x18\x1c \x01(\x0b\x32\x37.google.cloud.alloydb.v1beta.Instance.PscInstanceConfigB\x03\xe0\x41\x01\x12X\n\x0enetwork_config\x18\x1d \x01(\x0b\x32;.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfigB\x03\xe0\x41\x01\x12O\n\rgemini_config\x18! \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.GeminiInstanceConfigB\x05\x18\x01\xe0\x41\x01\x12\x31\n\x1coutbound_public_ip_addresses\x18\" \x03(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12V\n\x11\x61\x63tivation_policy\x18# \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.Instance.ActivationPolicyB\x03\xe0\x41\x01\x12_\n\x16\x63onnection_pool_config\x18% \x01(\x0b\x32:.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfigB\x03\xe0\x41\x01\x12G\n\ngca_config\x18& \x01(\x0b\x32..google.cloud.alloydb.v1beta.GCAInstanceConfigB\x03\xe0\x41\x03\x1a\x38\n\rMachineConfig\x12\x11\n\tcpu_count\x18\x01 \x01(\x05\x12\x14\n\x0cmachine_type\x18\x04 \x01(\t\x1aR\n\x04Node\x12\x14\n\x07zone_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02ip\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05state\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a\xfa\x01\n\x1bQueryInsightsInstanceConfig\x12$\n\x17record_application_tags\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\"\n\x15record_client_address\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x1b\n\x13query_string_length\x18\x04 \x01(\r\x12#\n\x16query_plans_per_minute\x18\x05 \x01(\rH\x02\x88\x01\x01\x42\x1a\n\x18_record_application_tagsB\x18\n\x16_record_client_addressB\x19\n\x17_query_plans_per_minute\x1a\xfa\x04\n\x1bObservabilityInstanceConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1e\n\x11preserve_comments\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x1e\n\x11track_wait_events\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12(\n\x16track_wait_event_types\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12$\n\x17max_query_string_length\x18\x05 \x01(\x05H\x04\x88\x01\x01\x12$\n\x17record_application_tags\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12#\n\x16query_plans_per_minute\x18\x07 \x01(\x05H\x06\x88\x01\x01\x12!\n\x14track_active_queries\x18\x08 \x01(\x08H\x07\x88\x01\x01\x12!\n\x14track_client_address\x18\t \x01(\x08H\x08\x88\x01\x01\x12*\n\x1d\x61ssistive_experiences_enabled\x18\n \x01(\x08H\t\x88\x01\x01\x42\n\n\x08_enabledB\x14\n\x12_preserve_commentsB\x14\n\x12_track_wait_eventsB\x19\n\x17_track_wait_event_typesB\x1a\n\x18_max_query_string_lengthB\x1a\n\x18_record_application_tagsB\x19\n\x17_query_plans_per_minuteB\x17\n\x15_track_active_queriesB\x17\n\x15_track_client_addressB \n\x1e_assistive_experiences_enabled\x1a$\n\x0eReadPoolConfig\x12\x12\n\nnode_count\x18\x01 \x01(\x05\x1a\x91\x01\n\x0cUpdatePolicy\x12\x45\n\x04mode\x18\x01 \x01(\x0e\x32\x37.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode\":\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x0f\n\x0b\x46ORCE_APPLY\x10\x02\x1az\n\x16\x43lientConnectionConfig\x12\x1f\n\x12require_connectors\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12?\n\nssl_config\x18\x02 \x01(\x0b\x32&.google.cloud.alloydb.v1beta.SslConfigB\x03\xe0\x41\x01\x1a\x39\n\x12PscInterfaceConfig\x12#\n\x1bnetwork_attachment_resource\x18\x01 \x01(\t\x1a\xa9\x01\n\x17PscAutoConnectionConfig\x12\x18\n\x10\x63onsumer_project\x18\x01 \x01(\t\x12\x18\n\x10\x63onsumer_network\x18\x02 \x01(\t\x12\x1f\n\nip_address\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x13\n\x06status\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12$\n\x17\x63onsumer_network_status\x18\x05 \x01(\tB\x03\xe0\x41\x03\x1a\xe9\x02\n\x11PscInstanceConfig\x12Q\n\x17service_attachment_link\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12&\n\x19\x61llowed_consumer_projects\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cpsc_dns_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\\\n\x15psc_interface_configs\x18\x08 \x03(\x0b\x32\x38.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfigB\x03\xe0\x41\x01\x12`\n\x14psc_auto_connections\x18\t \x03(\x0b\x32=.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfigB\x03\xe0\x41\x01\x1a\xee\x02\n\x15InstanceNetworkConfig\x12x\n\x1c\x61uthorized_external_networks\x18\x01 \x03(\x0b\x32M.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetworkB\x03\xe0\x41\x01\x12\x1d\n\x10\x65nable_public_ip\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12&\n\x19\x65nable_outbound_public_ip\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x04 \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12(\n\x1b\x61llocated_ip_range_override\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x31\n\x11\x41uthorizedNetwork\x12\x1c\n\ncidr_range\x18\x01 \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x1a\xd0\x01\n\x14\x43onnectionPoolConfig\x12\x14\n\x07\x65nabled\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12Y\n\x05\x66lags\x18\r \x03(\x0b\x32\x45.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.FlagsEntryB\x03\xe0\x41\x01\x12\x19\n\x0cpooler_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x1a,\n\nFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12\x44\x61tabaseFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x91\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0f\n\x0bMAINTENANCE\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x11\n\rBOOTSTRAPPING\x10\x08\x12\r\n\tPROMOTING\x10\t\"X\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tREAD_POOL\x10\x02\x12\r\n\tSECONDARY\x10\x03\"N\n\x10\x41vailabilityType\x12!\n\x1d\x41VAILABILITY_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05ZONAL\x10\x01\x12\x0c\n\x08REGIONAL\x10\x02\"L\n\x10\x41\x63tivationPolicy\x12!\n\x1d\x41\x43TIVATION_POLICY_UNSPECIFIED\x10\x00\x12\n\n\x06\x41LWAYS\x10\x01\x12\t\n\x05NEVER\x10\x02:\x8e\x01\xea\x41\x8a\x01\n\x1f\x61lloydb.googleapis.com/Instance\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}*\tinstances2\x08instanceR\x01\x01\"\xea\x02\n\x0e\x43onnectionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\nip_address\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12&\n\x11public_ip_address\x18\x05 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12$\n\x15pem_certificate_chain\x18\x03 \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x19\n\x0cinstance_uid\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cpsc_dns_name\x18\x06 \x01(\tB\x03\xe0\x41\x03:\xac\x01\xea\x41\xa8\x01\n%alloydb.googleapis.com/ConnectionInfo\x12^projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo*\x0f\x63onnectionInfos2\x0e\x63onnectionInfo\"\xa9\r\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x16\x63reate_completion_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x06 \x03(\x0b\x32/.google.cloud.alloydb.v1beta.Backup.LabelsEntry\x12=\n\x05state\x18\x07 \x01(\x0e\x32).google.cloud.alloydb.v1beta.Backup.StateB\x03\xe0\x41\x03\x12\x36\n\x04type\x18\x08 \x01(\x0e\x32(.google.cloud.alloydb.v1beta.Backup.Type\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12\x18\n\x0b\x63luster_uid\x18\x12 \x01(\tB\x03\xe0\x41\x03\x12<\n\x0c\x63luster_name\x18\n \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x18\n\x0breconciling\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03\x12M\n\x11\x65ncryption_config\x18\x0c \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12I\n\x0f\x65ncryption_info\x18\r \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0e \x01(\t\x12I\n\x0b\x61nnotations\x18\x10 \x03(\x0b\x32\x34.google.cloud.alloydb.v1beta.Backup.AnnotationsEntry\x12\x17\n\nsize_bytes\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpiry_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x0f\x65xpiry_quantity\x18\x14 \x01(\x0b\x32\x37.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiryB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x15 \x01(\x08\x42\x03\xe0\x41\x03\x12K\n\x10\x64\x61tabase_version\x18\x16 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\x03\xe0\x41\x03\x12\x46\n\x04tags\x18\x19 \x03(\x0b\x32-.google.cloud.alloydb.v1beta.Backup.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1aW\n\x13QuantityBasedExpiry\x12\x1c\n\x0fretention_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\"\n\x15total_retention_count\x18\x02 \x01(\x05\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\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"J\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\x12\x0e\n\nCONTINUOUS\x10\x03:p\xea\x41m\n\x1d\x61lloydb.googleapis.com/Backup\x12\x38projects/{project}/locations/{location}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kupR\x01\x01\"\x90\t\n\x15SupportedDatabaseFlag\x12\x64\n\x13string_restrictions\x18\x07 \x01(\x0b\x32\x45.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsH\x00\x12\x66\n\x14integer_restrictions\x18\x08 \x01(\x0b\x32\x46.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsH\x00\x12\"\n\x18recommended_string_value\x18\n \x01(\tH\x01\x12@\n\x19recommended_integer_value\x18\x0b \x01(\x0b\x32\x1b.google.protobuf.Int64ValueH\x01\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tflag_name\x18\x02 \x01(\t\x12P\n\nvalue_type\x18\x03 \x01(\x0e\x32<.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType\x12\x1f\n\x17\x61\x63\x63\x65pts_multiple_values\x18\x04 \x01(\x08\x12K\n\x15supported_db_versions\x18\x05 \x03(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12\x1b\n\x13requires_db_restart\x18\x06 \x01(\x08\x12G\n\x05scope\x18\t \x01(\x0e\x32\x38.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope\x1a,\n\x12StringRestrictions\x12\x16\n\x0e\x61llowed_values\x18\x01 \x03(\t\x1au\n\x13IntegerRestrictions\x12.\n\tmin_value\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12.\n\tmax_value\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"U\n\tValueType\x12\x1a\n\x16VALUE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\x0b\n\x07INTEGER\x10\x02\x12\t\n\x05\x46LOAT\x10\x03\x12\x08\n\x04NONE\x10\x04\"A\n\x05Scope\x12\x15\n\x11SCOPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44\x41TABASE\x10\x01\x12\x13\n\x0f\x43ONNECTION_POOL\x10\x02:\x97\x01\xea\x41\x93\x01\n,alloydb.googleapis.com/SupportedDatabaseFlag\x12\x34projects/{project}/locations/{location}/flags/{flag}*\x16supportedDatabaseFlags2\x15supportedDatabaseFlagB\x0e\n\x0crestrictionsB\x13\n\x11recommended_value\"\xfe\x02\n\x04User\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08password\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x1b\n\x0e\x64\x61tabase_roles\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x42\n\tuser_type\x18\x05 \x01(\x0e\x32*.google.cloud.alloydb.v1beta.User.UserTypeB\x03\xe0\x41\x01\x12\x1d\n\x10keep_extra_roles\x18\x06 \x01(\x08\x42\x03\xe0\x41\x04\"Q\n\x08UserType\x12\x19\n\x15USER_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41LLOYDB_BUILT_IN\x10\x01\x12\x14\n\x10\x41LLOYDB_IAM_USER\x10\x02:y\xea\x41v\n\x1b\x61lloydb.googleapis.com/User\x12Gprojects/{project}/locations/{location}/clusters/{cluster}/users/{user}*\x05users2\x04userR\x01\x01\"\x82\x03\n\x08\x44\x61tabase\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x17\n\x07\x63harset\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x19\n\tcollation\x18\x03 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1e\n\x0e\x63haracter_type\x18\x04 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1a\n\x0bis_template\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12!\n\x11\x64\x61tabase_template\x18\x06 \x01(\tB\x06\xe0\x41\x04\xe0\x41\x05\x12&\n\x14is_template_database\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01:\x8e\x01\xea\x41\x8a\x01\n\x1f\x61lloydb.googleapis.com/Database\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/databases/{database}*\tdatabases2\x08\x64\x61tabaseR\x01\x01\x42\x17\n\x15_is_template_database*^\n\x0cInstanceView\x12\x1d\n\x19INSTANCE_VIEW_UNSPECIFIED\x10\x00\x12\x17\n\x13INSTANCE_VIEW_BASIC\x10\x01\x12\x16\n\x12INSTANCE_VIEW_FULL\x10\x02*g\n\x0b\x43lusterView\x12\x1c\n\x18\x43LUSTER_VIEW_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43LUSTER_VIEW_BASIC\x10\x01\x12\"\n\x1e\x43LUSTER_VIEW_CONTINUOUS_BACKUP\x10\x02*\x9d\x01\n\x0f\x44\x61tabaseVersion\x12 \n\x1c\x44\x41TABASE_VERSION_UNSPECIFIED\x10\x00\x12\x13\n\x0bPOSTGRES_13\x10\x01\x1a\x02\x08\x01\x12\x0f\n\x0bPOSTGRES_14\x10\x02\x12\x0f\n\x0bPOSTGRES_15\x10\x03\x12\x0f\n\x0bPOSTGRES_16\x10\x04\x12\x0f\n\x0bPOSTGRES_17\x10\x05\x12\x0f\n\x0bPOSTGRES_18\x10\x06*N\n\x10SubscriptionType\x12!\n\x1dSUBSCRIPTION_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\t\n\x05TRIAL\x10\x02\x42\xbb\x05\n\x1f\x63om.google.cloud.alloydb.v1betaB\x0eResourcesProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1beta\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.type.TimeOfDay", "google/type/timeofday.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.type.Date", "google/type/date.proto"], + ["google.cloud.alloydb.v1beta.CloudSQLBackupRunSource", "google/cloud/alloydb/v1beta/csql_resources.proto"], + ["google.cloud.alloydb.v1beta.GeminiClusterConfig", "google/cloud/alloydb/v1beta/gemini.proto"], + ["google.protobuf.Int64Value", "google/protobuf/wrappers.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module AlloyDB + module V1beta + UserPassword = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.UserPassword").msgclass + MigrationSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MigrationSource").msgclass + MigrationSource::MigrationSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType").enummodule + EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.EncryptionConfig").msgclass + EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.EncryptionInfo").msgclass + EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.EncryptionInfo.Type").enummodule + SslConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SslConfig").msgclass + SslConfig::SslMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SslConfig.SslMode").enummodule + SslConfig::CaSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SslConfig.CaSource").enummodule + AutomatedBackupPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.AutomatedBackupPolicy").msgclass + AutomatedBackupPolicy::WeeklySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule").msgclass + AutomatedBackupPolicy::TimeBasedRetention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention").msgclass + AutomatedBackupPolicy::QuantityBasedRetention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention").msgclass + ContinuousBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ContinuousBackupConfig").msgclass + ContinuousBackupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ContinuousBackupInfo").msgclass + BackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.BackupSource").msgclass + ContinuousBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ContinuousBackupSource").msgclass + MaintenanceUpdatePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy").msgclass + MaintenanceUpdatePolicy::MaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow").msgclass + MaintenanceUpdatePolicy::DenyMaintenancePeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod").msgclass + MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MaintenanceSchedule").msgclass + Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster").msgclass + Cluster::NetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.NetworkConfig").msgclass + Cluster::SecondaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.SecondaryConfig").msgclass + Cluster::PrimaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.PrimaryConfig").msgclass + Cluster::PscConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.PscConfig").msgclass + Cluster::TrialMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.TrialMetadata").msgclass + Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.State").enummodule + Cluster::ClusterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.ClusterType").enummodule + Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance").msgclass + Instance::MachineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.MachineConfig").msgclass + Instance::Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.Node").msgclass + Instance::QueryInsightsInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig").msgclass + Instance::ObservabilityInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig").msgclass + Instance::ReadPoolConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ReadPoolConfig").msgclass + Instance::UpdatePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.UpdatePolicy").msgclass + Instance::UpdatePolicy::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode").enummodule + Instance::ClientConnectionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig").msgclass + Instance::PscInterfaceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig").msgclass + Instance::PscAutoConnectionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig").msgclass + Instance::PscInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.PscInstanceConfig").msgclass + Instance::InstanceNetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig").msgclass + Instance::InstanceNetworkConfig::AuthorizedNetwork = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork").msgclass + Instance::ConnectionPoolConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig").msgclass + Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.State").enummodule + Instance::InstanceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.InstanceType").enummodule + Instance::AvailabilityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.AvailabilityType").enummodule + Instance::ActivationPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ActivationPolicy").enummodule + ConnectionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ConnectionInfo").msgclass + Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Backup").msgclass + Backup::QuantityBasedExpiry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry").msgclass + Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Backup.State").enummodule + Backup::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Backup.Type").enummodule + SupportedDatabaseFlag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag").msgclass + SupportedDatabaseFlag::StringRestrictions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions").msgclass + SupportedDatabaseFlag::IntegerRestrictions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions").msgclass + SupportedDatabaseFlag::ValueType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType").enummodule + SupportedDatabaseFlag::Scope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope").enummodule + User = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.User").msgclass + User::UserType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.User.UserType").enummodule + Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Database").msgclass + InstanceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.InstanceView").enummodule + ClusterView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ClusterView").enummodule + DatabaseVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.DatabaseVersion").enummodule + SubscriptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SubscriptionType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_pb.rb new file mode 100644 index 000000000000..ddc512a8ddfe --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_pb.rb @@ -0,0 +1,136 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/alloydb/v1beta/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/alloydb/v1beta/data_model_pb' +require 'google/cloud/alloydb/v1beta/resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n)google/cloud/alloydb/v1beta/service.proto\x12\x1bgoogle.cloud.alloydb.v1beta\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/cloud/alloydb/v1beta/data_model.proto\x1a+google/cloud/alloydb/v1beta/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa5\x01\n\x13ListClustersRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"|\n\x14ListClustersResponse\x12\x36\n\x08\x63lusters\x18\x01 \x03(\x0b\x32$.google.cloud.alloydb.v1beta.Cluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x86\x01\n\x11GetClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12;\n\x04view\x18\x02 \x01(\x0e\x32(.google.cloud.alloydb.v1beta.ClusterViewB\x03\xe0\x41\x01\"\xe1\x01\n\x1d\x43reateSecondaryClusterRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x07\x63luster\x18\x03 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xd8\x01\n\x14\x43reateClusterRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x07\x63luster\x18\x03 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xd9\x01\n\x14UpdateClusterRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12:\n\x07\x63luster\x18\x02 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\"\n\x0eGcsDestination\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x81\x06\n\x14\x45xportClusterRequest\x12K\n\x0fgcs_destination\x18\x02 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.GcsDestinationB\x03\xe0\x41\x02H\x00\x12`\n\x12\x63sv_export_options\x18\x04 \x01(\x0b\x32\x42.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptionsH\x01\x12`\n\x12sql_export_options\x18\x05 \x01(\x0b\x32\x42.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptionsH\x01\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x15\n\x08\x64\x61tabase\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x88\x01\n\x10\x43svExportOptions\x12\x19\n\x0cselect_query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x66ield_delimiter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fquote_character\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x65scape_character\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\xde\x01\n\x10SqlExportOptions\x12\x13\n\x06tables\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x0bschema_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12&\n\x14\x63lean_target_objects\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12)\n\x17if_exist_target_objects\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x0e\n\x0c_schema_onlyB\x17\n\x15_clean_target_objectsB\x1a\n\x18_if_exist_target_objectsB\r\n\x0b\x64\x65stinationB\x10\n\x0e\x65xport_options\"s\n\x15\x45xportClusterResponse\x12K\n\x0fgcs_destination\x18\x02 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.GcsDestinationB\x03\xe0\x41\x02H\x00\x42\r\n\x0b\x64\x65stination\"\x90\x04\n\x14ImportClusterRequest\x12`\n\x12sql_import_options\x18\x04 \x01(\x0b\x32\x42.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptionsH\x00\x12`\n\x12\x63sv_import_options\x18\x07 \x01(\x0b\x32\x42.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptionsH\x00\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x14\n\x07gcs_uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08\x64\x61tabase\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04user\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x12\n\x10SqlImportOptions\x1a\x97\x01\n\x10\x43svImportOptions\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x63olumns\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x66ield_delimiter\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fquote_character\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x65scape_character\x18\x05 \x01(\tB\x03\xe0\x41\x01\x42\x10\n\x0eimport_options\"6\n\x15ImportClusterResponse\x12\x1d\n\x10\x62ytes_downloaded\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\"\xe1\x01\n\x15UpgradeClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x42\n\x07version\x18\x02 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\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\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x86\x0b\n\x16UpgradeClusterResponse\x12J\n\x06status\x18\x01 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x0f\n\x07message\x18\x02 \x01(\t\x12j\n\x17\x63luster_upgrade_details\x18\x03 \x03(\x0b\x32I.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails\x1a\xb3\x01\n\tStageInfo\x12H\n\x05stage\x18\x01 \x01(\x0e\x32\x39.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage\x12J\n\x06status\x18\x02 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x10\n\x08logs_url\x18\x03 \x01(\t\x1a\xc5\x01\n\x16InstanceUpgradeDetails\x12\x0c\n\x04name\x18\x01 \x01(\t\x12R\n\x0eupgrade_status\x18\x02 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12I\n\rinstance_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.alloydb.v1beta.Instance.InstanceType\x1a\xca\x03\n\x15\x43lusterUpgradeDetails\x12\x0c\n\x04name\x18\x01 \x01(\t\x12R\n\x0eupgrade_status\x18\x02 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x46\n\x0c\x63luster_type\x18\x03 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.Cluster.ClusterType\x12\x46\n\x10\x64\x61tabase_version\x18\x04 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12Q\n\nstage_info\x18\x05 \x03(\x0b\x32=.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo\x12l\n\x18instance_upgrade_details\x18\x06 \x03(\x0b\x32J.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails\"\x97\x01\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNOT_STARTED\x10\x04\x12\x0f\n\x0bIN_PROGRESS\x10\x05\x12\x0b\n\x07SUCCESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\x13\n\x0fPARTIAL_SUCCESS\x10\x03\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x06\x12\r\n\tCANCELLED\x10\x07\"\xbd\x01\n\x05Stage\x12\x15\n\x11STAGE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41LLOYDB_PRECHECK\x10\x01\x12\x14\n\x10PG_UPGRADE_CHECK\x10\x02\x12\x17\n\x13PREPARE_FOR_UPGRADE\x10\x05\x12\x1c\n\x18PRIMARY_INSTANCE_UPGRADE\x10\x03\x12\x1f\n\x1bREAD_POOL_INSTANCES_UPGRADE\x10\x04\x12\x0c\n\x08ROLLBACK\x10\x06\x12\x0b\n\x07\x43LEANUP\x10\x07\"\xa8\x01\n\x14\x44\x65leteClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\x85\x01\n\x18SwitchoverClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x95\x01\n\x15PromoteClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x80\x03\n\x15RestoreClusterRequest\x12\x42\n\rbackup_source\x18\x04 \x01(\x0b\x32).google.cloud.alloydb.v1beta.BackupSourceH\x00\x12W\n\x18\x63ontinuous_backup_source\x18\x08 \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.ContinuousBackupSourceH\x00\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x07\x63luster\x18\x03 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x42\x08\n\x06source\"\xa7\x01\n\x14ListInstancesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Instance\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x7f\n\x15ListInstancesResponse\x12\x38\n\tinstances\x18\x01 \x03(\x0b\x32%.google.cloud.alloydb.v1beta.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x84\x01\n\x12GetInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x37\n\x04view\x18\x02 \x01(\x0e\x32).google.cloud.alloydb.v1beta.InstanceView\"\xdd\x01\n\x15\x43reateInstanceRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Instance\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08instance\x18\x03 \x01(\x0b\x32%.google.cloud.alloydb.v1beta.InstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xe6\x01\n\x1e\x43reateSecondaryInstanceRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Instance\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08instance\x18\x03 \x01(\x0b\x32%.google.cloud.alloydb.v1beta.InstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"s\n\x16\x43reateInstanceRequests\x12Y\n\x18\x63reate_instance_requests\x18\x01 \x03(\x0b\x32\x32.google.cloud.alloydb.v1beta.CreateInstanceRequestB\x03\xe0\x41\x02\"\xbb\x01\n\x1b\x42\x61tchCreateInstancesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Instance\x12J\n\x08requests\x18\x02 \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.CreateInstanceRequestsB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"X\n\x1c\x42\x61tchCreateInstancesResponse\x12\x38\n\tinstances\x18\x01 \x03(\x0b\x32%.google.cloud.alloydb.v1beta.Instance\"\x95\x02\n\x1c\x42\x61tchCreateInstancesMetadata\x12\x18\n\x10instance_targets\x18\x01 \x03(\t\x12j\n\x11instance_statuses\x18\x02 \x03(\x0b\x32O.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.InstanceStatusesEntry\x1ao\n\x15InstanceStatusesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus:\x02\x38\x01\"\xd8\x02\n\x19\x42\x61tchCreateInstanceStatus\x12K\n\x05state\x18\x01 \x01(\x0e\x32<.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State\x12\x11\n\terror_msg\x18\x02 \x01(\t\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\x12@\n\x04type\x18\x03 \x01(\x0e\x32\x32.google.cloud.alloydb.v1beta.Instance.InstanceType\"v\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0ePENDING_CREATE\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x0f\n\x0bROLLED_BACK\x10\x06\"\xdc\x01\n\x15UpdateInstanceRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12<\n\x08instance\x18\x02 \x01(\x0b\x32%.google.cloud.alloydb.v1beta.InstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\x96\x01\n\x15\x44\x65leteInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x85\x01\n\x17\x46\x61iloverInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x8a\x02\n\x12InjectFaultRequest\x12R\n\nfault_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultTypeB\x03\xe0\x41\x02\x12\x35\n\x04name\x18\x02 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"4\n\tFaultType\x12\x1a\n\x16\x46\x41ULT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07STOP_VM\x10\x01\"\x9b\x01\n\x16RestartInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x15\n\x08node_ids\x18\x04 \x03(\tB\x03\xe0\x41\x01\"\xdc\x01\n\x11\x45xecuteSqlRequest\x12\x17\n\x08password\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x39\n\x08instance\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x15\n\x08\x64\x61tabase\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04user\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rsql_statement\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x42\x11\n\x0fuser_credential\"\x94\x01\n\x12\x45xecuteSqlResponse\x12;\n\x0bsql_results\x18\x01 \x03(\x0b\x32&.google.cloud.alloydb.v1beta.SqlResult\x12\x41\n\x08metadata\x18\x03 \x01(\x0b\x32/.google.cloud.alloydb.v1beta.ExecuteSqlMetadata\"\x8c\x02\n\x12\x45xecuteSqlMetadata\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x16\n\x0epartial_result\x18\x02 \x01(\x08\x12\x43\n sql_statement_execution_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x46\n\x06status\x18\x04 \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status\"@\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x01\x12\x0b\n\x07PARTIAL\x10\x02\x12\t\n\x05\x45RROR\x10\x03\"\x94\x01\n\x12ListBackupsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x61lloydb.googleapis.com/Backup\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\"y\n\x13ListBackupsResponse\x12\x34\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32#.google.cloud.alloydb.v1beta.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"G\n\x10GetBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61lloydb.googleapis.com/Backup\"\xd3\x01\n\x13\x43reateBackupRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x61lloydb.googleapis.com/Backup\x12\x16\n\tbackup_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x06\x62\x61\x63kup\x18\x03 \x01(\x0b\x32#.google.cloud.alloydb.v1beta.BackupB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xd6\x01\n\x13UpdateBackupRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x38\n\x06\x62\x61\x63kup\x18\x02 \x01(\x0b\x32#.google.cloud.alloydb.v1beta.BackupB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\x92\x01\n\x13\x44\x65leteBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61lloydb.googleapis.com/Backup\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xde\x01\n!ListSupportedDatabaseFlagsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,alloydb.googleapis.com/SupportedDatabaseFlag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12L\n\x05scope\x18\x06 \x01(\x0e\x32\x38.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ScopeB\x03\xe0\x41\x01\"\x93\x01\n\"ListSupportedDatabaseFlagsResponse\x12T\n\x18supported_database_flags\x18\x01 \x03(\x0b\x32\x32.google.cloud.alloydb.v1beta.SupportedDatabaseFlag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xff\x01\n GenerateClientCertificateRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\x07pem_csr\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x35\n\rcert_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x17\n\npublic_key\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15use_metadata_exchange\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"}\n!GenerateClientCertificateResponse\x12\x1e\n\x0fpem_certificate\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x03\x12\"\n\x15pem_certificate_chain\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12\x14\n\x07\x63\x61_cert\x18\x03 \x01(\tB\x03\xe0\x41\x01\"l\n\x18GetConnectionInfoRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb3\x04\n\x11OperationMetadata\x12i\n\x1f\x62\x61tch_create_instances_metadata\x18\x08 \x01(\x0b\x32\x39.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataB\x03\xe0\x41\x03H\x00\x12X\n\x16promote_cluster_status\x18\t \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.PromoteClusterStatusB\x03\xe0\x41\x03H\x00\x12X\n\x16upgrade_cluster_status\x18\n \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.UpgradeClusterStatusB\x03\xe0\x41\x03H\x00\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x42\x12\n\x10request_specific\"\xf4\x01\n\x14PromoteClusterStatus\x12K\n\x05state\x18\x01 \x01(\x0e\x32\x37.google.cloud.alloydb.v1beta.PromoteClusterStatus.StateB\x03\xe0\x41\x03\"\x8e\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12&\n\"PROMOTE_CLUSTER_AVAILABLE_FOR_READ\x10\x01\x12\'\n#PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE\x10\x02\x12\x1d\n\x19PROMOTE_CLUSTER_COMPLETED\x10\x03\"\xcd\t\n\x14UpgradeClusterStatus\x12I\n\x05state\x18\x01 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x13\n\x0b\x63\x61ncellable\x18\x02 \x01(\x08\x12\x44\n\x0esource_version\x18\x03 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12\x44\n\x0etarget_version\x18\x04 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12M\n\x06stages\x18\x05 \x03(\x0b\x32=.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus\x1a\x8d\x05\n\x0bStageStatus\x12|\n\x1bread_pool_instances_upgrade\x18\x0b \x01(\x0b\x32U.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatusH\x00\x12H\n\x05stage\x18\x01 \x01(\x0e\x32\x39.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage\x12I\n\x05state\x18\x02 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x62\n\x08schedule\x18\x03 \x01(\x0b\x32K.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageScheduleB\x03\xe0\x41\x03\x1a\xed\x01\n\rStageSchedule\x12\x38\n\x14\x65stimated_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11\x61\x63tual_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\x12\x65stimated_end_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0f\x61\x63tual_end_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x17\n\x15stage_specific_status\x1a\xe9\x01\n#ReadPoolInstancesUpgradeStageStatus\x12r\n\rupgrade_stats\x18\x01 \x01(\x0b\x32[.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats\x1aN\n\x05Stats\x12\x13\n\x0bnot_started\x18\x01 \x01(\x05\x12\x0f\n\x07ongoing\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x05\x12\x0e\n\x06\x66\x61iled\x18\x04 \x01(\x05\"\xa4\x01\n\x10ListUsersRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x61lloydb.googleapis.com/User\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\"s\n\x11ListUsersResponse\x12\x30\n\x05users\x18\x01 \x03(\x0b\x32!.google.cloud.alloydb.v1beta.User\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"C\n\x0eGetUserRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61lloydb.googleapis.com/User\"\xc9\x01\n\x11\x43reateUserRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x61lloydb.googleapis.com/User\x12\x14\n\x07user_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x04user\x18\x03 \x01(\x0b\x32!.google.cloud.alloydb.v1beta.UserB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xd0\x01\n\x11UpdateUserRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x34\n\x04user\x18\x02 \x01(\x0b\x32!.google.cloud.alloydb.v1beta.UserB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"{\n\x11\x44\x65leteUserRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61lloydb.googleapis.com/User\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x95\x01\n\x14ListDatabasesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Database\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\"j\n\x15ListDatabasesResponse\x12\x38\n\tdatabases\x18\x01 \x03(\x0b\x32%.google.cloud.alloydb.v1beta.Database\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x15\x43reateDatabaseRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Database\x12\x18\n\x0b\x64\x61tabase_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08\x64\x61tabase\x18\x03 \x01(\x0b\x32%.google.cloud.alloydb.v1beta.DatabaseB\x03\xe0\x41\x02\x32\x95\x41\n\x0c\x41lloyDBAdmin\x12\xb6\x01\n\x0cListClusters\x12\x30.google.cloud.alloydb.v1beta.ListClustersRequest\x1a\x31.google.cloud.alloydb.v1beta.ListClustersResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1beta/{parent=projects/*/locations/*}/clusters\x12\xa3\x01\n\nGetCluster\x12..google.cloud.alloydb.v1beta.GetClusterRequest\x1a$.google.cloud.alloydb.v1beta.Cluster\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1beta/{name=projects/*/locations/*/clusters/*}\x12\xdf\x01\n\rCreateCluster\x12\x31.google.cloud.alloydb.v1beta.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02;\"0/v1beta/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xe1\x01\n\rUpdateCluster\x12\x31.google.cloud.alloydb.v1beta.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02\x43\x32\x38/v1beta/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\x99\x02\n\rExportCluster\x12\x31.google.cloud.alloydb.v1beta.ExportClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x01\xca\x41*\n\x15\x45xportClusterResponse\x12\x11OperationMetadata\xda\x41\x43name,gcs_destination,database,csv_export_options,sql_export_options\x82\xd3\xe4\x93\x02<\"7/v1beta/{name=projects/*/locations/*/clusters/*}:export:\x01*\x12\xf0\x01\n\rImportCluster\x12\x31.google.cloud.alloydb.v1beta.ImportClusterRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41*\n\x15ImportClusterResponse\x12\x11OperationMetadata\xda\x41\x1aname,gcs_uri,database,user\x82\xd3\xe4\x93\x02<\"7/v1beta/{name=projects/*/locations/*/clusters/*}:import:\x01*\x12\xe6\x01\n\x0eUpgradeCluster\x12\x32.google.cloud.alloydb.v1beta.UpgradeClusterRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41+\n\x16UpgradeClusterResponse\x12\x11OperationMetadata\xda\x41\x0cname,version\x82\xd3\xe4\x93\x02=28/v1beta/{name=projects/*/locations/*/clusters/*}:upgrade:\x01*\x12\xcf\x01\n\rDeleteCluster\x12\x31.google.cloud.alloydb.v1beta.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1beta/{name=projects/*/locations/*/clusters/*}\x12\xce\x01\n\x0ePromoteCluster\x12\x32.google.cloud.alloydb.v1beta.PromoteClusterRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v1beta/{name=projects/*/locations/*/clusters/*}:promote:\x01*\x12\xd7\x01\n\x11SwitchoverCluster\x12\x35.google.cloud.alloydb.v1beta.SwitchoverClusterRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v1beta/{name=projects/*/locations/*/clusters/*}:switchover:\x01*\x12\xc7\x01\n\x0eRestoreCluster\x12\x32.google.cloud.alloydb.v1beta.RestoreClusterRequest\x1a\x1d.google.longrunning.Operation\"b\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02=\"8/v1beta/{parent=projects/*/locations/*}/clusters:restore:\x01*\x12\x82\x02\n\x16\x43reateSecondaryCluster\x12:.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02K\"@/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary:\x07\x63luster\x12\xc5\x01\n\rListInstances\x12\x31.google.cloud.alloydb.v1beta.ListInstancesRequest\x1a\x32.google.cloud.alloydb.v1beta.ListInstancesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12*\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1beta/{name=projects/*/locations/*/backups/*}\x12\xd8\x01\n\x0c\x43reateBackup\x12\x30.google.cloud.alloydb.v1beta.CreateBackupRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\xda\x41\x17parent,backup,backup_id\x82\xd3\xe4\x93\x02\x39\"//v1beta/{parent=projects/*/locations/*}/backups:\x06\x62\x61\x63kup\x12\xda\x01\n\x0cUpdateBackup\x12\x30.google.cloud.alloydb.v1beta.UpdateBackupRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\xda\x41\x12\x62\x61\x63kup,update_mask\x82\xd3\xe4\x93\x02@26/v1beta/{backup.name=projects/*/locations/*/backups/*}:\x06\x62\x61\x63kup\x12\xcc\x01\n\x0c\x44\x65leteBackup\x12\x30.google.cloud.alloydb.v1beta.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v1beta/{name=projects/*/locations/*/backups/*}\x12\xee\x01\n\x1aListSupportedDatabaseFlags\x12>.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest\x1a?.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags\x12\xfc\x01\n\x19GenerateClientCertificate\x12=.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest\x1a>.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse\"`\xda\x41\x06parent\x82\xd3\xe4\x93\x02Q\"L/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate:\x01*\x12\xd7\x01\n\x11GetConnectionInfo\x12\x35.google.cloud.alloydb.v1beta.GetConnectionInfoRequest\x1a+.google.cloud.alloydb.v1beta.ConnectionInfo\"^\xda\x41\x06parent\x82\xd3\xe4\x93\x02O\x12M/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo\x12\xb5\x01\n\tListUsers\x12-.google.cloud.alloydb.v1beta.ListUsersRequest\x1a..google.cloud.alloydb.v1beta.ListUsersResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1beta/{parent=projects/*/locations/*/clusters/*}/users\x12\xa2\x01\n\x07GetUser\x12+.google.cloud.alloydb.v1beta.GetUserRequest\x1a!.google.cloud.alloydb.v1beta.User\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1beta/{name=projects/*/locations/*/clusters/*/users/*}\x12\xbd\x01\n\nCreateUser\x12..google.cloud.alloydb.v1beta.CreateUserRequest\x1a!.google.cloud.alloydb.v1beta.User\"\\\xda\x41\x13parent,user,user_id\x82\xd3\xe4\x93\x02@\"8/v1beta/{parent=projects/*/locations/*/clusters/*}/users:\x04user\x12\xbf\x01\n\nUpdateUser\x12..google.cloud.alloydb.v1beta.UpdateUserRequest\x1a!.google.cloud.alloydb.v1beta.User\"^\xda\x41\x10user,update_mask\x82\xd3\xe4\x93\x02\x45\x32=/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}:\x04user\x12\x9d\x01\n\nDeleteUser\x12..google.cloud.alloydb.v1beta.DeleteUserRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1beta/{name=projects/*/locations/*/clusters/*/users/*}\x12\xc5\x01\n\rListDatabases\x12\x31.google.cloud.alloydb.v1beta.ListDatabasesRequest\x1a\x32.google.cloud.alloydb.v1beta.ListDatabasesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..fb9115c630af --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..cea53f02d1a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..b836bdb60b21 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..71b994c7ef20 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb new file mode 100644 index 000000000000..02d71d45cc06 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + # The source CloudSQL backup resource. + # @!attribute [rw] project + # @return [::String] + # The project ID of the source CloudSQL instance. This should be the same as + # the AlloyDB cluster's project. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The CloudSQL instance ID. + # @!attribute [rw] backup_run_id + # @return [::Integer] + # Required. The CloudSQL backup run ID. + class CloudSQLBackupRunSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_service.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_service.rb new file mode 100644 index 000000000000..0ba7d0f8a16d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_service.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + # Message for registering Restoring from CloudSQL resource. + # @!attribute [rw] cloudsql_backup_run_source + # @return [::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource] + # Cluster created from CloudSQL backup run. + # @!attribute [rw] parent + # @return [::String] + # Required. The location of the new cluster. For the required format, see the + # comment on Cluster.name field. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. ID of the requesting object. + # @!attribute [rw] cluster + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] + # Required. The resource being created + class RestoreFromCloudSQLRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/data_model.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/data_model.rb new file mode 100644 index 000000000000..0d34312057a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/data_model.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + # SqlResult represents the result for the execution of a sql statement. + # @!attribute [rw] columns + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SqlResultColumn>] + # List of columns included in the result. This also includes the data type + # of the column. + # @!attribute [rw] rows + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SqlResultRow>] + # Rows returned by the SQL statement. + class SqlResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains the name and datatype of a column in a SQL Result. + # @!attribute [rw] name + # @return [::String] + # Name of the column. + # @!attribute [rw] type + # @return [::String] + # Datatype of the column as reported by the postgres driver. + # Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", + # "INT", and "BIGINT". + class SqlResultColumn + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single row from a sql result. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SqlResultValue>] + # List of values in a row of sql result. + class SqlResultRow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single value in a row from a sql result. + # @!attribute [rw] value + # @return [::String] + # The cell value represented in string format. + # Timestamps are converted to string using RFC3339Nano format. + # @!attribute [rw] null_value + # @return [::Boolean] + # Set to true if cell value is null. + class SqlResultValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/gemini.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/gemini.rb new file mode 100644 index 000000000000..57f44b3de8b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/gemini.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + # Deprecated and unused. This message will be removed in the near future. + # @!attribute [r] entitled + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Output only. Deprecated and unused. This field will be removed in the near + # future. + class GeminiClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Deprecated and unused. This message will be removed in the near future. + # @!attribute [r] entitled + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Output only. Deprecated and unused. This field will be removed in the near + # future. + class GeminiInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Instance level configuration parameters related to the Gemini Cloud Assist + # product. + # @!attribute [r] gca_entitlement + # @return [::Google::Cloud::AlloyDB::V1beta::GCAEntitlementType] + # Output only. Represents the GCA entitlement state of the instance. + class GCAInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enum representing the type of GCA entitlement assigned to a resource. + module GCAEntitlementType + # No GCA entitlement is assigned. + GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0 + + # The resource is entitled to the GCA Standard Tier. + GCA_STANDARD = 1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb new file mode 100644 index 000000000000..a22e3fc7e742 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb @@ -0,0 +1,1801 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + # The username/password for a database user. Used for specifying initial + # users at cluster creation time. + # @!attribute [rw] user + # @return [::String] + # The database username. + # @!attribute [rw] password + # @return [::String] + # The initial password for the user. + class UserPassword + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Subset of the source instance configuration that is available when reading + # the cluster resource. + # @!attribute [r] host_port + # @return [::String] + # Output only. The host and port of the on-premises instance in host:port + # format + # @!attribute [r] reference_id + # @return [::String] + # Output only. Place holder for the external source identifier(e.g DMS job + # name) that created the cluster. + # @!attribute [r] source_type + # @return [::Google::Cloud::AlloyDB::V1beta::MigrationSource::MigrationSourceType] + # Output only. Type of migration source. + class MigrationSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Denote the type of migration source that created this cluster. + module MigrationSourceType + # Migration source is unknown. + MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0 + + # DMS source means the cluster was created via DMS migration job. + DMS = 1 + end + end + + # EncryptionConfig describes the encryption config of a cluster or a backup + # that is encrypted with a CMEK (customer-managed encryption key). + # @!attribute [rw] kms_key_name + # @return [::String] + # The fully-qualified resource name of the KMS key. + # Each Cloud KMS key is regionalized and has the following format: + # projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] + class EncryptionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # EncryptionInfo describes the encryption information of a cluster or a backup. + # @!attribute [r] encryption_type + # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionInfo::Type] + # Output only. Type of encryption. + # @!attribute [r] kms_key_versions + # @return [::Array<::String>] + # Output only. Cloud KMS key versions that are being used to protect the + # database or the backup. + class EncryptionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible encryption types. + module Type + # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. + TYPE_UNSPECIFIED = 0 + + # The data is encrypted at rest with a key that is fully managed by Google. + # No key version will be populated. This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1 + + # The data is encrypted at rest with a key that is managed by the customer. + # KMS key versions will be populated. + CUSTOMER_MANAGED_ENCRYPTION = 2 + end + end + + # SSL configuration. + # @!attribute [rw] ssl_mode + # @return [::Google::Cloud::AlloyDB::V1beta::SslConfig::SslMode] + # Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. + # @!attribute [rw] ca_source + # @return [::Google::Cloud::AlloyDB::V1beta::SslConfig::CaSource] + # Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is + # supported currently, and is the default value. + class SslConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # SSL mode options. + module SslMode + # SSL mode is not specified. Defaults to ENCRYPTED_ONLY. + SSL_MODE_UNSPECIFIED = 0 + + # SSL connections are optional. CA verification not enforced. + SSL_MODE_ALLOW = 1 + + # SSL connections are required. CA verification not enforced. + # Clients may use locally self-signed certificates (default psql client + # behavior). + SSL_MODE_REQUIRE = 2 + + # SSL connections are required. CA verification enforced. + # Clients must have certificates signed by a Cluster CA, for example, using + # GenerateClientCertificate. + SSL_MODE_VERIFY_CA = 3 + + # SSL connections are optional. CA verification not enforced. + ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4 + + # SSL connections are required. CA verification not enforced. + ENCRYPTED_ONLY = 5 + end + + # Certificate Authority (CA) source for SSL/TLS certificates. + module CaSource + # Certificate Authority (CA) source not specified. Defaults to + # CA_SOURCE_MANAGED. + CA_SOURCE_UNSPECIFIED = 0 + + # Certificate Authority (CA) managed by the AlloyDB Cluster. + CA_SOURCE_MANAGED = 1 + end + end + + # Message describing the user-specified automated backup policy. + # + # All fields in the automated backup policy are optional. Defaults for each + # field are provided if they are not set. + # @!attribute [rw] weekly_schedule + # @return [::Google::Cloud::AlloyDB::V1beta::AutomatedBackupPolicy::WeeklySchedule] + # Weekly schedule for the Backup. + # @!attribute [rw] time_based_retention + # @return [::Google::Cloud::AlloyDB::V1beta::AutomatedBackupPolicy::TimeBasedRetention] + # Time-based Backup retention policy. + # + # Note: The following fields are mutually exclusive: `time_based_retention`, `quantity_based_retention`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] quantity_based_retention + # @return [::Google::Cloud::AlloyDB::V1beta::AutomatedBackupPolicy::QuantityBasedRetention] + # Quantity-based Backup retention policy to retain recent backups. + # + # Note: The following fields are mutually exclusive: `quantity_based_retention`, `time_based_retention`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] enabled + # @return [::Boolean] + # Whether automated automated backups are enabled. If not set, defaults to + # true. + # @!attribute [rw] backup_window + # @return [::Google::Protobuf::Duration] + # The length of the time window during which a backup can be + # taken. If a backup does not succeed within this time window, it will be + # canceled and considered failed. + # + # The backup window must be at least 5 minutes long. There is no upper bound + # on the window. If not set, it defaults to 1 hour. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionConfig] + # Optional. The encryption config can be specified to encrypt the + # backups with a customer-managed encryption key (CMEK). When this field is + # not specified, the backup will use the cluster's encryption config. + # @!attribute [rw] location + # @return [::String] + # The location where the backup will be stored. Currently, the only supported + # option is to store the backup in the same region as the cluster. + # + # If empty, defaults to the region of the cluster. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels to apply to backups created using this configuration. + class AutomatedBackupPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A weekly schedule starts a backup at prescribed start times within a + # day, for the specified days of the week. + # + # The weekly schedule message is flexible and can be used to create many + # types of schedules. For example, to have a daily backup that starts at + # 22:00, configure the `start_times` field to have one element "22:00" and + # the `days_of_week` field to have all seven days of the week. + # @!attribute [rw] start_times + # @return [::Array<::Google::Type::TimeOfDay>] + # The times during the day to start a backup. The start times are assumed + # to be in UTC and to be an exact hour (e.g., 04:00:00). + # + # If no start times are provided, a single fixed start time is chosen + # arbitrarily. + # @!attribute [rw] days_of_week + # @return [::Array<::Google::Type::DayOfWeek>] + # The days of the week to perform a backup. + # + # If this field is left empty, the default of every day of the week is + # used. + class WeeklySchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A time based retention policy specifies that all backups within a certain + # time period should be retained. + # @!attribute [rw] retention_period + # @return [::Google::Protobuf::Duration] + # The retention period. + class TimeBasedRetention + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A quantity based policy specifies that a certain number of the most recent + # successful backups should be retained. + # @!attribute [rw] count + # @return [::Integer] + # The number of backups to retain. + class QuantityBasedRetention + 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 + + # ContinuousBackupConfig describes the continuous backups recovery + # configurations of a cluster. + # @!attribute [rw] enabled + # @return [::Boolean] + # Whether ContinuousBackup is enabled. + # @!attribute [rw] recovery_window_days + # @return [::Integer] + # The number of days that are eligible to restore from using PITR. To support + # the entire recovery window, backups and logs are retained for one day more + # than the recovery window. If not set, defaults to 14 days. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionConfig] + # The encryption config can be specified to encrypt the + # backups with a customer-managed encryption key (CMEK). When this field is + # not specified, the backup will use the cluster's encryption config. + class ContinuousBackupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ContinuousBackupInfo describes the continuous backup properties of a + # cluster. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionInfo] + # Output only. The encryption information for the WALs and backups required + # for ContinuousBackup. + # @!attribute [r] enabled_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When ContinuousBackup was most recently enabled. Set to null + # if ContinuousBackup is not enabled. + # @!attribute [r] schedule + # @return [::Array<::Google::Type::DayOfWeek>] + # Output only. Days of the week on which a continuous backup is taken. + # @!attribute [r] earliest_restorable_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The earliest restorable time that can be restored to. If + # continuous backups and recovery was recently enabled, the earliest + # restorable time is the creation time of the earliest eligible backup within + # this cluster's continuous backup recovery window. After a cluster has had + # continuous backups enabled for the duration of its recovery window, the + # earliest restorable time becomes "now minus the recovery window". For + # example, assuming a point in time recovery is attempted at 04/16/2025 + # 3:23:00PM with a 14d recovery window, the earliest restorable time would be + # 04/02/2025 3:23:00PM. This field is only visible if the + # CLUSTER_VIEW_CONTINUOUS_BACKUP cluster view is provided. + class ContinuousBackupInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing a BackupSource. + # @!attribute [r] backup_uid + # @return [::String] + # Output only. The system-generated UID of the backup which was used to + # create this resource. The UID is generated when the backup is created, and + # it is retained until the backup is deleted. + # @!attribute [rw] backup_name + # @return [::String] + # Required. The name of the backup resource with the format: + # * projects/\\{project}/locations/\\{region}/backups/\\{backup_id} + class BackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing a ContinuousBackupSource. + # @!attribute [rw] cluster + # @return [::String] + # Required. The source cluster from which to restore. This cluster must have + # continuous backup enabled for this operation to succeed. For the required + # format, see the comment on the Cluster.name field. + # @!attribute [rw] point_in_time + # @return [::Google::Protobuf::Timestamp] + # Required. The point in time to restore to. + class ContinuousBackupSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # MaintenanceUpdatePolicy defines the policy for system updates. + # @!attribute [rw] maintenance_windows + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::MaintenanceUpdatePolicy::MaintenanceWindow>] + # Preferred windows to perform maintenance. Currently limited to 1. + # @!attribute [rw] deny_maintenance_periods + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::MaintenanceUpdatePolicy::DenyMaintenancePeriod>] + # Periods to deny maintenance. Currently limited to 1. + class MaintenanceUpdatePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # MaintenanceWindow specifies a preferred day and time for maintenance. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Preferred time to start the maintenance operation on the specified day. + # Maintenance will start within 1 hour of this time. + class MaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DenyMaintenancePeriod definition. Excepting emergencies, maintenance + # will not be scheduled to start within this deny period. The start_date must + # be less than the end_date. + # @!attribute [rw] start_date + # @return [::Google::Type::Date] + # Deny period start date. + # This can be: + # * A full date, with non-zero year, month and day values OR + # * A month and day value, with a zero year for recurring + # @!attribute [rw] end_date + # @return [::Google::Type::Date] + # Deny period end date. + # This can be: + # * A full date, with non-zero year, month and day values OR + # * A month and day value, with a zero year for recurring + # @!attribute [rw] time + # @return [::Google::Type::TimeOfDay] + # Time in UTC when the deny period starts on start_date and ends on + # end_date. This can be: + # * Full time OR + # * All zeros for 00:00:00 UTC + class DenyMaintenancePeriod + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # MaintenanceSchedule stores the maintenance schedule generated from + # the MaintenanceUpdatePolicy, once a maintenance rollout is triggered, if + # MaintenanceWindow is set, and if there is no conflicting DenyPeriod. + # The schedule is cleared once the update takes place. This field cannot be + # manually changed; modify the MaintenanceUpdatePolicy instead. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The scheduled start time for the maintenance. + class MaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A cluster is a collection of regional AlloyDB resources. It can include a + # primary instance and one or more read pool instances. + # All cluster resources share a storage layer, which scales as needed. + # @!attribute [r] backup_source + # @return [::Google::Cloud::AlloyDB::V1beta::BackupSource] + # Output only. Cluster created from backup. + # + # Note: The following fields are mutually exclusive: `backup_source`, `migration_source`, `cloudsql_backup_run_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] migration_source + # @return [::Google::Cloud::AlloyDB::V1beta::MigrationSource] + # Output only. Cluster created via DMS migration. + # + # Note: The following fields are mutually exclusive: `migration_source`, `backup_source`, `cloudsql_backup_run_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] cloudsql_backup_run_source + # @return [::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource] + # Output only. Cluster created from CloudSQL snapshot. + # + # Note: The following fields are mutually exclusive: `cloudsql_backup_run_source`, `backup_source`, `migration_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the cluster resource with the format: + # * projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id} + # where the cluster ID segment should satisfy the regex expression + # `[a-z0-9-]+`. For more details see https://google.aip.dev/122. + # The prefix of the cluster resource name is the name of the parent resource: + # * projects/\\{project}/locations/\\{region} + # @!attribute [rw] display_name + # @return [::String] + # User-settable and human-readable display name for the Cluster. + # @!attribute [r] uid + # @return [::String] + # Output only. The system-generated UID of the resource. The UID is assigned + # when the resource is created, and it is retained until it is deleted. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time stamp + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time stamp + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Delete time stamp + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [r] state + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::State] + # Output only. The current serving state of the cluster. + # @!attribute [r] cluster_type + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::ClusterType] + # Output only. The type of the cluster. This is an output-only field and it's + # populated at the Cluster creation time or the Cluster promotion + # time. The cluster type is determined by which RPC was used to create + # the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` + # @!attribute [rw] database_version + # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] + # Optional. The database engine major version. This is an optional field and + # it is populated at the Cluster creation time. If a database version is not + # supplied at cluster creation time, then a default database version will + # be used. + # @!attribute [rw] network_config + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::NetworkConfig] + # @!attribute [rw] network + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Required. The resource link for the VPC network in which cluster resources + # are created and from which they are accessible via Private IP. The network + # must belong to the same project as the cluster. It is specified in the + # form: `projects/{project}/global/networks/{network_id}`. This is required + # to create a cluster. Deprecated, use network_config.network instead. + # @!attribute [rw] etag + # @return [::String] + # For Resource freshness validation (https://google.aip.dev/154) + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Annotations to allow client tools to store small amount of arbitrary data. + # This is distinct from labels. + # https://google.aip.dev/128 + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Reconciling (https://google.aip.dev/128#reconciliation). + # Set to true if the current state of Cluster does not match the user's + # intended state, and the service is actively updating the resource to + # reconcile them. This can happen due to user-triggered updates or + # system actions like failover or maintenance. + # @!attribute [rw] initial_user + # @return [::Google::Cloud::AlloyDB::V1beta::UserPassword] + # Input only. Initial user to setup during cluster creation. Required. + # If used in `RestoreCluster` this is ignored. + # @!attribute [rw] automated_backup_policy + # @return [::Google::Cloud::AlloyDB::V1beta::AutomatedBackupPolicy] + # The automated backup policy for this cluster. + # + # If no policy is provided then the default policy will be used. If backups + # are supported for the cluster, the default policy takes one backup a day, + # has a backup window of 1 hour, and retains backups for 14 days. + # For more information on the defaults, consult the + # documentation for the message type. + # @!attribute [rw] ssl_config + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::AlloyDB::V1beta::SslConfig] + # SSL configuration for this AlloyDB cluster. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionConfig] + # Optional. The encryption config can be specified to encrypt the data disks + # and other persistent data resources of a cluster with a + # customer-managed encryption key (CMEK). When this field is not + # specified, the cluster will then use default encryption scheme to + # protect the user data. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionInfo] + # Output only. The encryption information for the cluster. + # @!attribute [rw] continuous_backup_config + # @return [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupConfig] + # Optional. Continuous backup configuration for this cluster. + # @!attribute [r] continuous_backup_info + # @return [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupInfo] + # Output only. Continuous backup properties for this cluster. + # @!attribute [rw] secondary_config + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::SecondaryConfig] + # Cross Region replication config specific to SECONDARY cluster. + # @!attribute [r] primary_config + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::PrimaryConfig] + # Output only. Cross Region replication config specific to PRIMARY cluster. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [rw] psc_config + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::PscConfig] + # Optional. The configuration for Private Service Connect (PSC) for the + # cluster. + # @!attribute [rw] maintenance_update_policy + # @return [::Google::Cloud::AlloyDB::V1beta::MaintenanceUpdatePolicy] + # Optional. The maintenance update policy determines when to allow or deny + # updates. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::AlloyDB::V1beta::MaintenanceSchedule] + # Output only. The maintenance schedule for the cluster, generated for a + # specific rollout if a maintenance window is set. + # @!attribute [rw] gemini_config + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::AlloyDB::V1beta::GeminiClusterConfig] + # Optional. Deprecated and unused. This field will be removed in the near + # future. + # @!attribute [rw] subscription_type + # @return [::Google::Cloud::AlloyDB::V1beta::SubscriptionType] + # Optional. Subscription type of the cluster. + # @!attribute [r] trial_metadata + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::TrialMetadata] + # Output only. Metadata for free trial clusters + # @!attribute [rw] tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Input only. Immutable. Tag keys/values directly bound to this + # resource. For example: + # ``` + # "123/environment": "production", + # "123/costCenter": "marketing" + # ``` + # @!attribute [r] service_account_email + # @return [::String] + # Output only. AlloyDB per-cluster service account. This service account is + # created per-cluster per-project, and is different from the per-project + # service account. The per-cluster service account naming format is subject + # to change. + class Cluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Metadata related to network configuration. + # @!attribute [rw] network + # @return [::String] + # Optional. The resource link for the VPC network in which cluster + # resources are created and from which they are accessible via Private IP. + # The network must belong to the same project as the cluster. It is + # specified in the form: + # `projects/{project_number}/global/networks/{network_id}`. This is + # required to create a cluster. + # @!attribute [rw] allocated_ip_range + # @return [::String] + # Optional. Name of the allocated IP range for the private IP AlloyDB + # cluster, for example: "google-managed-services-default". If set, the + # instance IPs for this cluster will be created in the allocated range. The + # range name must comply with RFC 1035. Specifically, the name must be 1-63 + # characters long and match the regular expression + # `[a-z]([-a-z0-9]*[a-z0-9])?`. + # Field name is intended to be consistent with Cloud SQL. + class NetworkConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration information for the secondary cluster. This should be set + # if and only if the cluster is of type SECONDARY. + # @!attribute [rw] primary_cluster_name + # @return [::String] + # The name of the primary cluster name with the format: + # * projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id} + class SecondaryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the primary cluster. It has the list of clusters that are + # replicating from this cluster. This should be set if and only if the + # cluster is of type PRIMARY. + # @!attribute [r] secondary_cluster_names + # @return [::Array<::String>] + # Output only. Names of the clusters that are replicating from this + # cluster. + class PrimaryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PscConfig contains PSC related configuration at a cluster level. + # @!attribute [rw] psc_enabled + # @return [::Boolean] + # Optional. Create an instance that allows connections from Private Service + # Connect endpoints to the instance. + # @!attribute [r] service_owned_project_number + # @return [::Integer] + # Output only. The project number that needs to be allowlisted on the + # network attachment to enable outbound connectivity. + class PscConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains information and all metadata related to TRIAL clusters. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # start time of the trial cluster. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End time of the trial cluster. + # @!attribute [rw] upgrade_time + # @return [::Google::Protobuf::Timestamp] + # Upgrade time of trial cluster to Standard cluster. + # @!attribute [rw] grace_end_time + # @return [::Google::Protobuf::Timestamp] + # grace end time of the cluster. + class TrialMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cluster State + module State + # The state of the cluster is unknown. + STATE_UNSPECIFIED = 0 + + # The cluster is active and running. + READY = 1 + + # This is unused. Even when all instances in the cluster are stopped, the + # cluster remains in READY state. + STOPPED = 2 + + # The cluster is empty and has no associated resources. + # All instances, associated storage and backups have been deleted. + EMPTY = 3 + + # The cluster is being created. + CREATING = 4 + + # The cluster is being deleted. + DELETING = 5 + + # The creation of the cluster failed. + FAILED = 6 + + # The cluster is bootstrapping with data from some other source. + # Direct mutations to the cluster (e.g. adding read pool) are not allowed. + BOOTSTRAPPING = 7 + + # The cluster is under maintenance. AlloyDB regularly performs maintenance + # and upgrades on customer clusters. Updates on the cluster are + # not allowed while the cluster is in this state. + MAINTENANCE = 8 + + # The cluster is being promoted. + PROMOTING = 9 + end + + # Type of Cluster + module ClusterType + # The type of the cluster is unknown. + CLUSTER_TYPE_UNSPECIFIED = 0 + + # Primary cluster that support read and write operations. + PRIMARY = 1 + + # Secondary cluster that is replicating from another region. + # This only supports read. + SECONDARY = 2 + end + end + + # An Instance is a computing unit that an end customer can connect to. + # It's the main unit of computing resources in AlloyDB. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the instance resource with the format: + # * projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id}/instances/\\{instance_id} + # where the cluster and instance ID segments should satisfy the regex + # expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + # lowercase letters, numbers, and dashes, starting with a letter, and ending + # with a letter or number. For more details see https://google.aip.dev/122. + # The prefix of the instance resource name is the name of the parent + # resource: + # * projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id} + # @!attribute [rw] display_name + # @return [::String] + # User-settable and human-readable display name for the Instance. + # @!attribute [r] uid + # @return [::String] + # Output only. The system-generated UID of the resource. The UID is assigned + # when the resource is created, and it is retained until it is deleted. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time stamp + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time stamp + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Delete time stamp + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [r] state + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::State] + # Output only. The current serving state of the instance. + # @!attribute [rw] instance_type + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::InstanceType] + # Required. The type of the instance. Specified at creation time. + # @!attribute [rw] machine_config + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::MachineConfig] + # Configurations for the machines that host the underlying + # database engine. + # @!attribute [rw] availability_type + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::AvailabilityType] + # Availability type of an Instance. + # If empty, defaults to REGIONAL for primary instances. + # For read pools, availability_type is always UNSPECIFIED. Instances in the + # read pools are evenly distributed across available zones within the region + # (i.e. read pools with more than one node will have a node in at + # least two zones). + # @!attribute [rw] gce_zone + # @return [::String] + # The Compute Engine zone that the instance should serve from, per + # https://cloud.google.com/compute/docs/regions-zones + # This can ONLY be specified for ZONAL instances. + # If present for a REGIONAL instance, an error will be thrown. + # If this is absent for a ZONAL instance, instance is created in a random + # zone with available capacity. + # @!attribute [rw] database_flags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Database flags. Set at the instance level. + # They are copied from the primary instance on secondary instance creation. + # Flags that have restrictions default to the value at primary + # instance on read instances during creation. Read instances can set new + # flags or override existing flags that are relevant for reads, for example, + # for enabling columnar cache on a read instance. Flags set on read instance + # might or might not be present on the primary instance. + # + # + # This is a list of "key": "value" pairs. + # "key": The name of the flag. These flags are passed at instance setup time, + # so include both server options and system variables for Postgres. Flags are + # specified with underscores, not hyphens. + # "value": The value of the flag. Booleans are set to **on** for true + # and **off** for false. This field must be omitted if the flag + # doesn't take a value. + # @!attribute [r] writable_node + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::Node] + # Output only. This is set for the read-write VM of the PRIMARY instance + # only. + # @!attribute [r] nodes + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance::Node>] + # Output only. List of available read-only VMs in this instance, including + # the standby for a PRIMARY instance. + # @!attribute [rw] query_insights_config + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::QueryInsightsInstanceConfig] + # Configuration for query insights. + # @!attribute [rw] observability_config + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ObservabilityInstanceConfig] + # Configuration for observability. + # @!attribute [rw] read_pool_config + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ReadPoolConfig] + # Read pool instance configuration. + # This is required if the value of instanceType is READ_POOL. + # @!attribute [r] ip_address + # @return [::String] + # Output only. The IP address for the Instance. + # This is the connection endpoint for an end-user application. + # @!attribute [r] public_ip_address + # @return [::String] + # Output only. The public IP addresses for the Instance. This is available + # ONLY when enable_public_ip is set. This is the connection endpoint for an + # end-user application. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Reconciling (https://google.aip.dev/128#reconciliation). + # Set to true if the current state of Instance does not match the user's + # intended state, and the service is actively updating the resource to + # reconcile them. This can happen due to user-triggered updates or + # system actions like failover or maintenance. + # @!attribute [rw] etag + # @return [::String] + # For Resource freshness validation (https://google.aip.dev/154) + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Annotations to allow client tools to store small amount of arbitrary data. + # This is distinct from labels. + # https://google.aip.dev/128 + # @!attribute [rw] update_policy + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::UpdatePolicy] + # Update policy that will be applied during instance update. + # This field is not persisted when you update the instance. + # To use a non-default update policy, you must + # specify explicitly specify the value in each update request. + # @!attribute [rw] client_connection_config + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ClientConnectionConfig] + # Optional. Client connection specific configurations + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [rw] psc_instance_config + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::PscInstanceConfig] + # Optional. The configuration for Private Service Connect (PSC) for the + # instance. + # @!attribute [rw] network_config + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::InstanceNetworkConfig] + # Optional. Instance-level network configuration. + # @!attribute [rw] gemini_config + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::AlloyDB::V1beta::GeminiInstanceConfig] + # Optional. Deprecated and unused. This field will be removed in the near + # future. + # @!attribute [r] outbound_public_ip_addresses + # @return [::Array<::String>] + # Output only. All outbound public IP addresses configured for the instance. + # @!attribute [rw] activation_policy + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ActivationPolicy] + # Optional. Specifies whether an instance needs to spin up. Once the instance + # is active, the activation policy can be updated to the `NEVER` to stop the + # instance. Likewise, the activation policy can be updated to `ALWAYS` to + # start the instance. + # There are restrictions around when an instance can/cannot be activated (for + # example, a read pool instance should be stopped before stopping primary + # etc.). Please refer to the API documentation for more details. + # @!attribute [rw] connection_pool_config + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ConnectionPoolConfig] + # Optional. The configuration for Managed Connection Pool (MCP). + # @!attribute [r] gca_config + # @return [::Google::Cloud::AlloyDB::V1beta::GCAInstanceConfig] + # Output only. Configuration parameters related to Gemini Cloud Assist. + class Instance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # MachineConfig describes the configuration of a machine. + # @!attribute [rw] cpu_count + # @return [::Integer] + # The number of CPU's in the VM instance. + # @!attribute [rw] machine_type + # @return [::String] + # Machine type of the VM instance. E.g. "n2-highmem-4", + # "n2-highmem-8", "c4a-highmem-4-lssd". + # cpu_count must match the number of vCPUs in the machine type. + class MachineConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of a single node in the instance. + # Nodes in an AlloyDB instance are ephemeral, they can change during + # update, failover, autohealing and resize operations. + # @!attribute [r] zone_id + # @return [::String] + # Output only. The Compute Engine zone of the VM e.g. "us-central1-b". + # @!attribute [r] id + # @return [::String] + # Output only. The identifier of the VM e.g. + # "test-read-0601-407e52be-ms3l". + # @!attribute [r] ip + # @return [::String] + # Output only. The private IP address of the VM e.g. "10.57.0.34". + # @!attribute [r] state + # @return [::String] + # Output only. Determined by state of the compute VM and postgres-service + # health. Compute VM state can have values listed in + # https://cloud.google.com/compute/docs/instances/instance-life-cycle and + # postgres-service health can have values: HEALTHY and UNHEALTHY. + class Node + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # QueryInsights Instance specific configuration. + # @!attribute [rw] record_application_tags + # @return [::Boolean] + # Record application tags for an instance. + # This flag is turned "on" by default. + # @!attribute [rw] record_client_address + # @return [::Boolean] + # Record client address for an instance. Client address is PII information. + # This flag is turned "on" by default. + # @!attribute [rw] query_string_length + # @return [::Integer] + # Query string length. The default value is 1024. + # Any integer between 256 and 4500 is considered valid. + # @!attribute [rw] query_plans_per_minute + # @return [::Integer] + # Number of query execution plans captured by Insights per minute + # for all queries combined. The default value is 5. + # Any integer between 0 and 20 is considered valid. + class QueryInsightsInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Observability Instance specific configuration. + # @!attribute [rw] enabled + # @return [::Boolean] + # Observability feature status for an instance. + # This flag is turned "off" by default. + # @!attribute [rw] preserve_comments + # @return [::Boolean] + # Preserve comments in query string for an instance. + # This flag is turned "off" by default. + # @!attribute [rw] track_wait_events + # @return [::Boolean] + # Track wait events during query execution for an instance. + # This flag is turned "on" by default but tracking is enabled only after + # observability enabled flag is also turned on. + # @!attribute [r] track_wait_event_types + # @return [::Boolean] + # Output only. Track wait event types during query execution for an + # instance. This flag is turned "on" by default but tracking is enabled + # only after observability enabled flag is also turned on. This is + # read-only flag and only modifiable by internal API. + # @!attribute [rw] max_query_string_length + # @return [::Integer] + # Query string length. The default value is 10k. + # @!attribute [rw] record_application_tags + # @return [::Boolean] + # Record application tags for an instance. + # This flag is turned "off" by default. + # @!attribute [rw] query_plans_per_minute + # @return [::Integer] + # Number of query execution plans captured by Insights per minute + # for all queries combined. The default value is 200. + # Any integer between 0 to 200 is considered valid. + # @!attribute [rw] track_active_queries + # @return [::Boolean] + # Track actively running queries on the instance. + # If not set, this flag is "off" by default. + # @!attribute [rw] track_client_address + # @return [::Boolean] + # Track client address for an instance. + # If not set, default value is "off". + # @!attribute [rw] assistive_experiences_enabled + # @return [::Boolean] + # Whether assistive experiences are enabled for this AlloyDB instance. + class ObservabilityInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for a read pool instance. + # @!attribute [rw] node_count + # @return [::Integer] + # Read capacity, i.e. number of nodes in a read pool instance. + class ReadPoolConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Policy to be used while updating the instance. + # @!attribute [rw] mode + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::UpdatePolicy::Mode] + # Mode for updating the instance. + class UpdatePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies the available modes of update. + module Mode + # Mode is unknown. + MODE_UNSPECIFIED = 0 + + # Least disruptive way to apply the update. + DEFAULT = 1 + + # Performs a forced update when applicable. This will be fast but may + # incur a downtime. + FORCE_APPLY = 2 + end + end + + # Client connection configuration + # @!attribute [rw] require_connectors + # @return [::Boolean] + # Optional. Configuration to enforce connectors only (ex: AuthProxy) + # connections to the database. + # @!attribute [rw] ssl_config + # @return [::Google::Cloud::AlloyDB::V1beta::SslConfig] + # Optional. SSL configuration option for this instance. + class ClientConnectionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for setting up a PSC interface to enable outbound + # connectivity. + # @!attribute [rw] network_attachment_resource + # @return [::String] + # The network attachment resource created in the consumer network to which + # the PSC interface will be linked. This is of the format: + # "projects/$\\{CONSUMER_PROJECT}/regions/$\\{REGION}/networkAttachments/$\\{NETWORK_ATTACHMENT_NAME}". + # The network attachment must be in the same region as the instance. + class PscInterfaceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for setting up PSC service automation. Consumer projects in + # the configs will be allowlisted automatically for the instance. + # @!attribute [rw] consumer_project + # @return [::String] + # The consumer project to which the PSC service automation endpoint will + # be created. + # @!attribute [rw] consumer_network + # @return [::String] + # The consumer network for the PSC service automation, example: + # "projects/vpc-host-project/global/networks/default". + # The consumer network might be hosted a different project than the + # consumer project. + # @!attribute [r] ip_address + # @return [::String] + # Output only. The IP address of the PSC service automation endpoint. + # @!attribute [r] status + # @return [::String] + # Output only. The status of the PSC service automation connection. + # Possible values: + # "STATE_UNSPECIFIED" - An invalid state as the default case. + # "ACTIVE" - The connection has been created successfully. + # "FAILED" - The connection is not functional since some resources on the + # connection fail to be created. + # "CREATING" - The connection is being created. + # "DELETING" - The connection is being deleted. + # "CREATE_REPAIRING" - The connection is being repaired to complete + # creation. + # "DELETE_REPAIRING" - The connection is being repaired to complete + # deletion. + # @!attribute [r] consumer_network_status + # @return [::String] + # Output only. The status of the service connection policy. + # Possible values: + # "STATE_UNSPECIFIED" - Default state, when Connection Map is created + # initially. + # "VALID" - Set when policy and map configuration is valid, and their + # matching can lead to allowing creation of PSC Connections subject to + # other constraints like connections limit. + # "CONNECTION_POLICY_MISSING" - No Service Connection Policy found for + # this network and Service Class + # "POLICY_LIMIT_REACHED" - Service Connection Policy limit reached for + # this network and Service Class + # "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" - The consumer instance + # project is not in AllowedGoogleProducersResourceHierarchyLevels of the + # matching ServiceConnectionPolicy. + class PscAutoConnectionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PscInstanceConfig contains PSC related configuration at an + # instance level. + # @!attribute [r] service_attachment_link + # @return [::String] + # Output only. The service attachment created when Private + # Service Connect (PSC) is enabled for the instance. + # The name of the resource will be in the format of + # `projects//regions//serviceAttachments/` + # @!attribute [rw] allowed_consumer_projects + # @return [::Array<::String>] + # Optional. List of consumer projects that are allowed to create + # PSC endpoints to service-attachments to this instance. + # @!attribute [r] psc_dns_name + # @return [::String] + # Output only. The DNS name of the instance for PSC connectivity. + # Name convention: ...alloydb-psc.goog + # @!attribute [rw] psc_interface_configs + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance::PscInterfaceConfig>] + # Optional. Configurations for setting up PSC interfaces attached to the + # instance which are used for outbound connectivity. Only primary instances + # can have PSC interface attached. Currently we only support 0 or 1 PSC + # interface. + # @!attribute [rw] psc_auto_connections + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance::PscAutoConnectionConfig>] + # Optional. Configurations for setting up PSC service automation. + class PscInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to instance-level network configuration. + # @!attribute [rw] authorized_external_networks + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance::InstanceNetworkConfig::AuthorizedNetwork>] + # Optional. A list of external network authorized to access this instance. + # @!attribute [rw] enable_public_ip + # @return [::Boolean] + # Optional. Enabling public ip for the instance. + # @!attribute [rw] enable_outbound_public_ip + # @return [::Boolean] + # Optional. Enabling an outbound public IP address to support a database + # server sending requests out into the internet. + # @!attribute [r] network + # @return [::String] + # Output only. The resource link for the VPC network in which instance + # resources are created and from which they are accessible via Private IP. + # This will be the same value as the parent cluster's network. It is + # specified in the form: // + # `projects/{project_number}/global/networks/{network_id}`. + # @!attribute [rw] allocated_ip_range_override + # @return [::String] + # Optional. Name of the allocated IP range for the private IP AlloyDB + # instance, for example: "google-managed-services-default". If set, the + # instance IPs will be created from this allocated range and will override + # the IP range used by the parent cluster. The range name must comply with + # [RFC 1035](http://datatracker.ietf.org/doc/html/rfc1035). Specifically, + # the name must be 1-63 characters long and match the regular expression + # [a-z]([-a-z0-9]*[a-z0-9])?. + class InstanceNetworkConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # AuthorizedNetwork contains metadata for an authorized network. + # @!attribute [rw] cidr_range + # @return [::String] + # CIDR range for one authorzied network of the instance. + class AuthorizedNetwork + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Configuration for Managed Connection Pool (MCP). + # @!attribute [rw] enabled + # @return [::Boolean] + # Optional. Whether to enable Managed Connection Pool (MCP). + # @!attribute [rw] flags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Connection Pool flags, as a list of "key": "value" pairs. + # @!attribute [r] pooler_count + # @return [::Integer] + # Output only. The number of running poolers per instance. + class ConnectionPoolConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class FlagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class DatabaseFlagsEntry + 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 + + # Instance State + module State + # The state of the instance is unknown. + STATE_UNSPECIFIED = 0 + + # The instance is active and running. + READY = 1 + + # The instance is stopped. Instance name and IP resources are preserved. + STOPPED = 2 + + # The instance is being created. + CREATING = 3 + + # The instance is being deleted. + DELETING = 4 + + # The instance is down for maintenance. + MAINTENANCE = 5 + + # The creation of the instance failed or a fatal error occurred during + # an operation on the instance. + # Note: Instances in this state would tried to be auto-repaired. And + # Customers should be able to restart, update or delete these instances. + FAILED = 6 + + # Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that + # index unused in case that state also needs to exposed via consumer apis + # in future. + # The instance has been configured to sync data from some other source. + BOOTSTRAPPING = 8 + + # The instance is being promoted. + PROMOTING = 9 + end + + # Type of an Instance + module InstanceType + # The type of the instance is unknown. + INSTANCE_TYPE_UNSPECIFIED = 0 + + # PRIMARY instances support read and write operations. + PRIMARY = 1 + + # READ POOL instances support read operations only. Each read pool instance + # consists of one or more homogeneous nodes. + # * Read pool of size 1 can only have zonal availability. + # * Read pools with node count of 2 or more can have regional + # availability (nodes are present in 2 or more zones in a region). + READ_POOL = 2 + + # SECONDARY instances support read operations only. SECONDARY instance + # is a cross-region read replica + SECONDARY = 3 + end + + # The Availability type of an instance. Potential values: + # + # - ZONAL: The instance serves data from only one zone. Outages in that + # zone affect instance availability. + # - REGIONAL: The instance can serve data from more than one zone in a + # region (it is highly available). + module AvailabilityType + # This is an unknown Availability type. + AVAILABILITY_TYPE_UNSPECIFIED = 0 + + # Zonal available instance. + ZONAL = 1 + + # Regional (or Highly) available instance. + REGIONAL = 2 + end + + # Specifies whether an instance needs to spin up. + module ActivationPolicy + # The policy is not specified. + ACTIVATION_POLICY_UNSPECIFIED = 0 + + # The instance is running. + ALWAYS = 1 + + # The instance is not running. + NEVER = 2 + end + end + + # ConnectionInfo singleton resource. + # https://google.aip.dev/156 + # @!attribute [rw] name + # @return [::String] + # The name of the ConnectionInfo singleton resource, e.g.: + # projects/\\{project}/locations/\\{location}/clusters/*/instances/*/connectionInfo + # This field currently has no semantic meaning. + # @!attribute [r] ip_address + # @return [::String] + # Output only. The private network IP address for the Instance. This is the + # default IP for the instance and is always created (even if enable_public_ip + # is set). This is the connection endpoint for an end-user application. + # @!attribute [r] public_ip_address + # @return [::String] + # Output only. The public IP addresses for the Instance. This is available + # ONLY when enable_public_ip is set. This is the connection endpoint for an + # end-user application. + # @!attribute [r] pem_certificate_chain + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # Output only. The pem-encoded chain that may be used to verify the X.509 + # certificate. Expected to be in issuer-to-root order according to RFC 5246. + # @!attribute [r] instance_uid + # @return [::String] + # Output only. The unique ID of the Instance. + # @!attribute [r] psc_dns_name + # @return [::String] + # Output only. The DNS name to use with PSC for the Instance. + class ConnectionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing Backup object + # @!attribute [r] name + # @return [::String] + # Output only. The name of the backup resource with the format: + # * projects/\\{project}/locations/\\{region}/backups/\\{backup_id} + # where the cluster and backup ID segments should satisfy the regex + # expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of + # lowercase letters, numbers, and dashes, starting with a letter, and ending + # with a letter or number. For more details see https://google.aip.dev/122. + # The prefix of the backup resource name is the name of the parent + # resource: + # * projects/\\{project}/locations/\\{region} + # @!attribute [rw] display_name + # @return [::String] + # User-settable and human-readable display name for the Backup. + # @!attribute [r] uid + # @return [::String] + # Output only. The system-generated UID of the resource. The UID is assigned + # when the resource is created, and it is retained until it is deleted. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time stamp + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time stamp + # + # Users should not infer any meaning from this field. Its value is generally + # unrelated to the timing of the backup creation operation. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Delete time stamp + # @!attribute [r] create_completion_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp when the resource finished being created. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [r] state + # @return [::Google::Cloud::AlloyDB::V1beta::Backup::State] + # Output only. The current state of the backup. + # @!attribute [rw] type + # @return [::Google::Cloud::AlloyDB::V1beta::Backup::Type] + # The backup type, which suggests the trigger for the backup. + # @!attribute [rw] description + # @return [::String] + # User-provided description of the backup. + # @!attribute [r] cluster_uid + # @return [::String] + # Output only. The system-generated UID of the cluster which was used to + # create this resource. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The full resource name of the backup source cluster + # (e.g., projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id}). + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Reconciling (https://google.aip.dev/128#reconciliation), if + # true, indicates that the service is actively updating the resource. This + # can happen due to user-triggered updates or system actions like failover or + # maintenance. + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionConfig] + # Optional. The encryption config can be specified to encrypt the + # backup with a customer-managed encryption key (CMEK). When this field is + # not specified, the backup will then use default encryption scheme to + # protect the user data. + # @!attribute [r] encryption_info + # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionInfo] + # Output only. The encryption information for the backup. + # @!attribute [rw] etag + # @return [::String] + # For Resource freshness validation (https://google.aip.dev/154) + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Annotations to allow client tools to store small amount of arbitrary data. + # This is distinct from labels. + # https://google.aip.dev/128 + # @!attribute [r] size_bytes + # @return [::Integer] + # Output only. The size of the backup in bytes. + # @!attribute [r] expiry_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which after the backup is eligible to be garbage + # collected. It is the duration specified by the backup's retention policy, + # added to the backup's create_time. + # @!attribute [r] expiry_quantity + # @return [::Google::Cloud::AlloyDB::V1beta::Backup::QuantityBasedExpiry] + # Output only. The QuantityBasedExpiry of the backup, specified by the + # backup's retention policy. Once the expiry quantity is over retention, the + # backup is eligible to be garbage collected. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. Reserved for future use. + # @!attribute [r] database_version + # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] + # Output only. The database engine major version of the cluster this backup + # was created from. Any restored cluster created from this backup will have + # the same database version. + # @!attribute [rw] tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Input only. Immutable. Tag keys/values directly bound to this + # resource. For example: + # ``` + # "123/environment": "production", + # "123/costCenter": "marketing" + # ``` + class Backup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A backup's position in a quantity-based retention queue, of backups with + # the same source cluster and type, with length, retention, specified by the + # backup's retention policy. + # Once the position is greater than the retention, the backup is eligible to + # be garbage collected. + # + # Example: 5 backups from the same source cluster and type with a + # quantity-based retention of 3 and denoted by backup_id (position, + # retention). + # + # Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3). + # Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3) + # @!attribute [r] retention_count + # @return [::Integer] + # Output only. The backup's position among its backups with the same source + # cluster and type, by descending chronological order create time(i.e. + # newest first). + # @!attribute [r] total_retention_count + # @return [::Integer] + # Output only. The length of the quantity-based queue, specified by the + # backup's retention policy. + class QuantityBasedExpiry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Backup State + module State + # The state of the backup is unknown. + STATE_UNSPECIFIED = 0 + + # The backup is ready. + READY = 1 + + # The backup is creating. + CREATING = 2 + + # The backup failed. + FAILED = 3 + + # The backup is being deleted. + DELETING = 4 + end + + # Backup Type + module Type + # Backup Type is unknown. + TYPE_UNSPECIFIED = 0 + + # ON_DEMAND backups that were triggered by the customer (e.g., not + # AUTOMATED). + ON_DEMAND = 1 + + # AUTOMATED backups triggered by the automated backups scheduler pursuant + # to an automated backup policy. + AUTOMATED = 2 + + # CONTINUOUS backups triggered by the automated backups scheduler + # due to a continuous backup policy. + CONTINUOUS = 3 + end + end + + # SupportedDatabaseFlag gives general information about a database flag, + # like type and allowed values. This is a static value that is defined + # on the server side, and it cannot be modified by callers. + # To set the Database flags on a particular Instance, a caller should modify + # the Instance.database_flags field. + # @!attribute [rw] string_restrictions + # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::StringRestrictions] + # Restriction on STRING type value. + # + # Note: The following fields are mutually exclusive: `string_restrictions`, `integer_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] integer_restrictions + # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::IntegerRestrictions] + # Restriction on INTEGER type value. + # + # Note: The following fields are mutually exclusive: `integer_restrictions`, `string_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] recommended_string_value + # @return [::String] + # The recommended value for a STRING flag. + # + # Note: The following fields are mutually exclusive: `recommended_string_value`, `recommended_integer_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] recommended_integer_value + # @return [::Google::Protobuf::Int64Value] + # The recommended value for an INTEGER flag. + # + # Note: The following fields are mutually exclusive: `recommended_integer_value`, `recommended_string_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # The name of the flag resource, following Google Cloud conventions, e.g.: + # * projects/\\{project}/locations/\\{location}/flags/\\{flag} + # This field currently has no semantic meaning. + # @!attribute [rw] flag_name + # @return [::String] + # The name of the database flag, e.g. "max_allowed_packets". + # The is a possibly key for the Instance.database_flags map field. + # @!attribute [rw] value_type + # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::ValueType] + # @!attribute [rw] accepts_multiple_values + # @return [::Boolean] + # Whether the database flag accepts multiple values. If true, + # a comma-separated list of stringified values may be specified. + # @!attribute [rw] supported_db_versions + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::DatabaseVersion>] + # Major database engine versions for which this flag is supported. + # @!attribute [rw] requires_db_restart + # @return [::Boolean] + # Whether setting or updating this flag on an Instance requires a database + # restart. If a flag that requires database restart is set, the backend + # will automatically restart the database (making sure to satisfy any + # availability SLO's). + # @!attribute [rw] scope + # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::Scope] + # The scope of the flag. + class SupportedDatabaseFlag + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Restrictions on STRING type values + # @!attribute [rw] allowed_values + # @return [::Array<::String>] + # The list of allowed values, if bounded. This field will be empty + # if there is a unbounded number of allowed values. + class StringRestrictions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Restrictions on INTEGER type values. + # @!attribute [rw] min_value + # @return [::Google::Protobuf::Int64Value] + # The minimum value that can be specified, if applicable. + # @!attribute [rw] max_value + # @return [::Google::Protobuf::Int64Value] + # The maximum value that can be specified, if applicable. + class IntegerRestrictions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ValueType describes the semantic type of the value that the flag accepts. + # Regardless of the ValueType, the Instance.database_flags field accepts the + # stringified version of the value, i.e. "20" or "3.14". + module ValueType + # This is an unknown flag type. + VALUE_TYPE_UNSPECIFIED = 0 + + # String type flag. + STRING = 1 + + # Integer type flag. + INTEGER = 2 + + # Float type flag. + FLOAT = 3 + + # Denotes that the flag does not accept any values. + NONE = 4 + end + + # The scope of the flag. + module Scope + # The scope of the flag is not specified. Default is DATABASE. + SCOPE_UNSPECIFIED = 0 + + # The flag is a database flag. + DATABASE = 1 + + # The flag is a connection pool flag. + CONNECTION_POOL = 2 + end + end + + # Message describing User object. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the resource in the form of + # projects/\\{project}/locations/\\{location}/cluster/\\{cluster}/users/\\{user}. + # @!attribute [rw] password + # @return [::String] + # Input only. Password for the user. + # @!attribute [rw] database_roles + # @return [::Array<::String>] + # Optional. List of database roles this user has. + # The database role strings are subject to the PostgreSQL naming conventions. + # @!attribute [rw] user_type + # @return [::Google::Cloud::AlloyDB::V1beta::User::UserType] + # Optional. Type of this user. + # @!attribute [rw] keep_extra_roles + # @return [::Boolean] + # Input only. If the user already exists and it has additional roles, keep + # them granted. + class User + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that details the user type. + module UserType + # Unspecified user type. + USER_TYPE_UNSPECIFIED = 0 + + # The default user type that authenticates via password-based + # authentication. + ALLOYDB_BUILT_IN = 1 + + # Database user that can authenticate via IAM-Based authentication. + ALLOYDB_IAM_USER = 2 + end + end + + # Message describing Database object. + # @!attribute [rw] name + # @return [::String] + # Identifier. Name of the resource in the form of + # `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. + # @!attribute [rw] charset + # @return [::String] + # Optional. Immutable. Charset for the database. + # This field can contain any PostgreSQL supported charset name. + # Example values include "UTF8", "SQL_ASCII", etc. + # @!attribute [rw] collation + # @return [::String] + # Optional. Immutable. lc_collate for the database. + # String sort order. + # Example values include "C", "POSIX", etc. + # @!attribute [rw] character_type + # @return [::String] + # Optional. Immutable. lc_ctype for the database. + # Character classification (What is a letter? The upper-case equivalent?). + # Example values include "C", "POSIX", etc. + # @!attribute [rw] is_template + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Whether the database is a template database. + # Deprecated in favor of is_template_database. + # @!attribute [rw] database_template + # @return [::String] + # Input only. Immutable. Template of the database to be used for creating a + # new database. + # @!attribute [rw] is_template_database + # @return [::Boolean] + # Optional. Whether the database is a template database. + class Database + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # View on Instance. Pass this enum to rpcs that returns an Instance message to + # control which subsets of fields to get. + module InstanceView + # INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + INSTANCE_VIEW_UNSPECIFIED = 0 + + # BASIC server responses for a primary or read instance include all the + # relevant instance details, excluding the details of each node in the + # instance. The default value. + INSTANCE_VIEW_BASIC = 1 + + # FULL response is equivalent to BASIC for primary instance (for now). + # For read pool instance, this includes details of each node in the pool. + INSTANCE_VIEW_FULL = 2 + end + + # View on Cluster. Pass this enum to rpcs that returns a cluster message to + # control which subsets of fields to get. + module ClusterView + # CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. + CLUSTER_VIEW_UNSPECIFIED = 0 + + # BASIC server responses include all the relevant cluster details, excluding + # Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific + # fields. The default value. + CLUSTER_VIEW_BASIC = 1 + + # CONTINUOUS_BACKUP response returns all the fields from BASIC plus + # the earliest restorable time if continuous backups are enabled. + # May increase latency. + CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 + end + + # The supported database engine versions. + module DatabaseVersion + # This is an unknown database version. + DATABASE_VERSION_UNSPECIFIED = 0 + + # DEPRECATED - The database version is Postgres 13. + POSTGRES_13 = 1 + + # The database version is Postgres 14. + POSTGRES_14 = 2 + + # The database version is Postgres 15. + POSTGRES_15 = 3 + + # The database version is Postgres 16. + POSTGRES_16 = 4 + + # The database version is Postgres 17. + POSTGRES_17 = 5 + + # The database version is Postgres 18. + POSTGRES_18 = 6 + end + + # Subscription_type added to distinguish between Standard and Trial + # subscriptions. By default, a subscription type is considered STANDARD unless + # explicitly specified. + module SubscriptionType + # This is an unknown subscription type. By default, the subscription type is + # STANDARD. + SUBSCRIPTION_TYPE_UNSPECIFIED = 0 + + # Standard subscription. + STANDARD = 1 + + # Trial subscription. + TRIAL = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/service.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/service.rb new file mode 100644 index 000000000000..7ddbd54d52a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/service.rb @@ -0,0 +1,1871 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module AlloyDB + module V1beta + # Message for requesting list of Clusters + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Cluster.name field. Additionally, you can perform an + # aggregated list operation by specifying a value with the following format: + # * projects/\\{project}/locations/- + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results + class ListClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Clusters + # @!attribute [rw] clusters + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Cluster>] + # The list of Cluster + # @!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 ListClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Cluster + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field. + # @!attribute [rw] view + # @return [::Google::Cloud::AlloyDB::V1beta::ClusterView] + # Optional. The view of the cluster to return. Returns all default fields if + # not set. + class GetClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] parent + # @return [::String] + # Required. The location of the new cluster. For the required + # format, see the comment on the Cluster.name field. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. ID of the requesting object (the secondary cluster). + # @!attribute [rw] cluster + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] + # Required. Configuration of the requesting object (the secondary cluster). + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class CreateSecondaryClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Cluster + # @!attribute [rw] parent + # @return [::String] + # Required. The location of the new cluster. For the required format, see the + # comment on the Cluster.name field. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. ID of the requesting object. + # @!attribute [rw] cluster + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] + # 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class CreateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Cluster + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Cluster 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] cluster + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] + # 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set to true, update succeeds even if cluster is not found. In + # that case, a new cluster is created and `update_mask` is ignored. + class UpdateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Destination for Export. Export will be done to cloud storage. + # @!attribute [rw] uri + # @return [::String] + # Required. The path to the file in Google Cloud Storage where the export + # will be stored. The URI is in the form `gs://bucketName/fileName`. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Export cluster request. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::AlloyDB::V1beta::GcsDestination] + # Required. Option to export data to cloud storage. + # @!attribute [rw] csv_export_options + # @return [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::CsvExportOptions] + # Options for exporting data in CSV format. Required field to be set for + # CSV file type. + # + # Note: The following fields are mutually exclusive: `csv_export_options`, `sql_export_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] sql_export_options + # @return [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::SqlExportOptions] + # Options for exporting data in SQL format. Required field to be set for + # SQL file type. + # + # Note: The following fields are mutually exclusive: `sql_export_options`, `csv_export_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the cluster. + # @!attribute [rw] database + # @return [::String] + # Required. Name of the database where the export command will be executed. + # Note - Value provided should be the same as expected from + # `SELECT current_database();` and NOT as a resource reference. + class ExportClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options for exporting data in CSV format. + # @!attribute [rw] select_query + # @return [::String] + # Required. The SELECT query used to extract the data. + # @!attribute [rw] field_delimiter + # @return [::String] + # Optional. Specifies the character that separates columns within each row + # (line) of the file. The default is comma. The value of this argument has + # to be a character in Hex ASCII Code. + # @!attribute [rw] quote_character + # @return [::String] + # Optional. Specifies the quoting character to be used when a data value is + # quoted. The default is double-quote. The value of this argument has to be + # a character in Hex ASCII Code. + # @!attribute [rw] escape_character + # @return [::String] + # Optional. Specifies the character that should appear before a data + # character that needs to be escaped. The default is the same as quote + # character. The value of this argument has to be a character in Hex ASCII + # Code. + class CsvExportOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for exporting data in SQL format. + # @!attribute [rw] tables + # @return [::Array<::String>] + # Optional. Tables to export from. + # @!attribute [rw] schema_only + # @return [::Boolean] + # Optional. If true, only export the schema. + # @!attribute [rw] clean_target_objects + # @return [::Boolean] + # Optional. If true, output commands to DROP all the dumped database + # objects prior to outputting the commands for creating them. + # @!attribute [rw] if_exist_target_objects + # @return [::Boolean] + # Optional. If true, use DROP ... IF EXISTS commands to check for the + # object's existence before dropping it in clean_target_objects mode. + class SqlExportOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response of export cluster rpc. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::AlloyDB::V1beta::GcsDestination] + # Required. Option to export data to cloud storage. + class ExportClusterResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Import cluster request. + # @!attribute [rw] sql_import_options + # @return [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::SqlImportOptions] + # Options for importing data in SQL format. + # + # Note: The following fields are mutually exclusive: `sql_import_options`, `csv_import_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] csv_import_options + # @return [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::CsvImportOptions] + # Options for importing data in CSV format. + # + # Note: The following fields are mutually exclusive: `csv_import_options`, `sql_import_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the cluster. + # @!attribute [rw] gcs_uri + # @return [::String] + # Required. The path to the file in Google Cloud Storage where the source + # file for import will be stored. The URI is in the form + # `gs://bucketName/fileName`. + # @!attribute [rw] database + # @return [::String] + # Optional. Name of the database to which the import will be done. + # For import from SQL file, this is required only if the file does not + # specify a database. + # Note - Value provided should be the same as expected from `SELECT + # current_database();` and NOT as a resource reference. + # @!attribute [rw] user + # @return [::String] + # Optional. Database user to be used for importing the data. + # Note - Value provided should be the same as expected from + # `SELECT current_user;` and NOT as a resource reference. + class ImportClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options for importing data in SQL format. + class SqlImportOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options for importing data in CSV format. + # @!attribute [rw] table + # @return [::String] + # Required. The database table to import CSV file into. + # @!attribute [rw] columns + # @return [::Array<::String>] + # Optional. The columns to which CSV data is imported. If not specified, + # all columns of the database table are loaded with CSV data. + # @!attribute [rw] field_delimiter + # @return [::String] + # Optional. Specifies the character that separates columns within each row + # (line) of the file. The default is comma. The value of this argument has + # to be a character in Hex ASCII Code. + # @!attribute [rw] quote_character + # @return [::String] + # Optional. Specifies the quoting character to be used when a data value is + # quoted. The default is double-quote. The value of this argument has to be + # a character in Hex ASCII Code. + # @!attribute [rw] escape_character + # @return [::String] + # Optional. Specifies the character that should appear before a data + # character that needs to be escaped. The default is same as quote + # character. The value of this argument has to be a character in Hex ASCII + # Code. + class CsvImportOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response of import rpc. + # @!attribute [rw] bytes_downloaded + # @return [::Integer] + # Required. Size of the object downloaded from Google Cloud Storage in bytes. + class ImportClusterResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upgrades a cluster. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the cluster. + # @!attribute [rw] version + # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] + # Required. The version the cluster is going to be upgraded to. + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @!attribute [rw] etag + # @return [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # upgrade will be blocked and an ABORTED error will be returned. + class UpgradeClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UpgradeClusterResponse contains the response for upgrade cluster operation. + # @!attribute [rw] status + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] + # Status of upgrade operation. + # @!attribute [rw] message + # @return [::String] + # A user friendly message summarising the upgrade operation details and the + # next steps for the user if there is any. + # @!attribute [rw] cluster_upgrade_details + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::ClusterUpgradeDetails>] + # Array of upgrade details for the current cluster and all the secondary + # clusters associated with this cluster. + class UpgradeClusterResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Stage information for different stages in the upgrade process. + # @!attribute [rw] stage + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Stage] + # The stage. + # @!attribute [rw] status + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] + # Status of the stage. + # @!attribute [rw] logs_url + # @return [::String] + # logs_url is the URL for the logs associated with a stage if that stage + # has logs. Right now, only three stages have logs: ALLOYDB_PRECHECK, + # PG_UPGRADE_CHECK, PRIMARY_INSTANCE_UPGRADE. + class StageInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details regarding the upgrade of instances associated with a cluster. + # @!attribute [rw] name + # @return [::String] + # Normalized name of the instance. + # @!attribute [rw] upgrade_status + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] + # Upgrade status of the instance. + # @!attribute [rw] instance_type + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::InstanceType] + # Instance type. + class InstanceUpgradeDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upgrade details of a cluster. This cluster can be primary or secondary. + # @!attribute [rw] name + # @return [::String] + # Normalized name of the cluster + # @!attribute [rw] upgrade_status + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] + # Upgrade status of the cluster. + # @!attribute [rw] cluster_type + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::ClusterType] + # Cluster type which can either be primary or secondary. + # @!attribute [rw] database_version + # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] + # Database version of the cluster after the upgrade operation. This will be + # the target version if the upgrade was successful otherwise it remains the + # same as that before the upgrade operation. + # @!attribute [rw] stage_info + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::StageInfo>] + # Array containing stage info associated with this cluster. + # @!attribute [rw] instance_upgrade_details + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::InstanceUpgradeDetails>] + # Upgrade details of the instances directly associated with this cluster. + class ClusterUpgradeDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Status of upgrade operation. + module Status + # Unspecified status. + STATUS_UNSPECIFIED = 0 + + # Not started. + NOT_STARTED = 4 + + # In progress. + IN_PROGRESS = 5 + + # Operation succeeded. + SUCCESS = 1 + + # Operation failed. + FAILED = 2 + + # Operation partially succeeded. + PARTIAL_SUCCESS = 3 + + # Cancel is in progress. + CANCEL_IN_PROGRESS = 6 + + # Cancellation complete. + CANCELLED = 7 + end + + # Stage in the upgrade. + module Stage + # Unspecified stage. + STAGE_UNSPECIFIED = 0 + + # Pre-upgrade custom checks, not covered by pg_upgrade. + ALLOYDB_PRECHECK = 1 + + # Pre-upgrade pg_upgrade checks. + PG_UPGRADE_CHECK = 2 + + # Clone the original cluster. + PREPARE_FOR_UPGRADE = 5 + + # Upgrade the primary instance(downtime). + PRIMARY_INSTANCE_UPGRADE = 3 + + # This stage is read pool upgrade. + READ_POOL_INSTANCES_UPGRADE = 4 + + # Rollback in case of critical failures. + ROLLBACK = 6 + + # Cleanup. + CLEANUP = 7 + end + end + + # Message for deleting a Cluster + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field. + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] etag + # @return [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # deletion will be blocked and an ABORTED error will be returned. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. Whether to cascade delete child instances for given cluster. + class DeleteClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for switching over to a cluster + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class SwitchoverClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for promoting a Cluster + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Cluster.name field + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] etag + # @return [::String] + # Optional. The current etag of the Cluster. + # If an etag is provided and does not match the current etag of the Cluster, + # deletion will be blocked and an ABORTED error will be returned. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class PromoteClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for restoring a Cluster from a backup or another cluster at a given + # point in time. + # NEXT_ID: 11 + # @!attribute [rw] backup_source + # @return [::Google::Cloud::AlloyDB::V1beta::BackupSource] + # Backup source. + # + # Note: The following fields are mutually exclusive: `backup_source`, `continuous_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] continuous_backup_source + # @return [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupSource] + # ContinuousBackup source. Continuous backup needs to be enabled in the + # source cluster for this operation to succeed. + # + # Note: The following fields are mutually exclusive: `continuous_backup_source`, `backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Cluster.name field. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. ID of the requesting object. + # @!attribute [rw] cluster + # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] + # 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class RestoreClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Instances + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Instance.name field. Additionally, you can perform an + # aggregated list operation by specifying a value with one of the following + # formats: + # * projects/\\{project}/locations/-/clusters/- + # * projects/\\{project}/locations/\\{region}/clusters/- + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results + class ListInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Instances + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance>] + # The list of Instance + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Instance + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @!attribute [rw] view + # @return [::Google::Cloud::AlloyDB::V1beta::InstanceView] + # The view of the instance to return. + class GetInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Instance + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Instance.name field. + # @!attribute [rw] instance_id + # @return [::String] + # Required. ID of the requesting object. + # @!attribute [rw] instance + # @return [::Google::Cloud::AlloyDB::V1beta::Instance] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class CreateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Secondary Instance + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. For the required format, see the + # comment on the Instance.name field. + # @!attribute [rw] instance_id + # @return [::String] + # Required. ID of the requesting object. + # @!attribute [rw] instance + # @return [::Google::Cloud::AlloyDB::V1beta::Instance] + # Required. The resource being created + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class CreateSecondaryInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # See usage below for notes. + # @!attribute [rw] create_instance_requests + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest>] + # Required. Primary and read replica instances to be created. This list + # should not be empty. + class CreateInstanceRequests + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a batch of instances under the specified cluster. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. + # @!attribute [rw] requests + # @return [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests] + # Required. Resources 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating 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 BatchCreateInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating batches of instances in a cluster. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance>] + # Created instances. + class BatchCreateInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for metadata that is specific to BatchCreateInstances API. + # NEXT_ID: 3 + # @!attribute [rw] instance_targets + # @return [::Array<::String>] + # The instances being created in the API call. Each string in this list + # is the server defined resource path for target instances in the request + # and for the format of each string, see the comment on the Instance.name + # field. + # @!attribute [rw] instance_statuses + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstanceStatus}] + # A map representing state of the instances involved in the + # BatchCreateInstances operation during the operation execution. + # The instance state will be in STATE_UNSPECIFIED state if the instance has + # not yet been picked up for processing. + # The key of the map is the name of the instance resource. + # For the format, see the comment on the Instance.name field. + class BatchCreateInstancesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstanceStatus] + class InstanceStatusesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message for current status of an instance in the BatchCreateInstances + # operation. + # For example, lets say a BatchCreateInstances workflow has 4 instances, + # Instance1 through Instance4. Lets also assume that 2 instances succeeded + # but the third failed to create and the 4th was never picked up for creation + # because of failure of the previous one. Then, resulting states would look + # something like: + # 1. Instance1 = ROLLED_BACK + # 2. Instance2 = ROLLED_BACK + # 3. Instance3 = FAILED + # 4. Instance4 = FAILED + # + # However, while the operation is running, the instance might be in other + # states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states + # / do not get further updated once the operation is done. + # @!attribute [rw] state + # @return [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstanceStatus::State] + # The current state of an instance involved in the batch create operation. + # Once the operation is complete, the final state of the instances in the + # LRO can be one of: + # 1. ACTIVE, indicating that instances were created successfully + # 2. FAILED, indicating that a particular instance failed creation + # 3. ROLLED_BACK indicating that although the instance was created + # successfully, it had to be rolled back and deleted due to failure in + # other steps of the workflow. + # @!attribute [rw] error_msg + # @return [::String] + # DEPRECATED - Use the error field instead. + # Error, if any error occurred and is available, during instance creation. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The RPC status of the instance creation operation. This field will be + # present if an error happened during the instance creation. + # @!attribute [rw] type + # @return [::Google::Cloud::AlloyDB::V1beta::Instance::InstanceType] + class BatchCreateInstanceStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State contains all valid instance states for the BatchCreateInstances + # operation. This is mainly used for status reporting through the LRO + # metadata. + module State + # The state of the instance is unknown. + STATE_UNSPECIFIED = 0 + + # Instance is pending creation and has not yet been picked up for + # processing in the backend. + PENDING_CREATE = 1 + + # The instance is active and running. + READY = 2 + + # The instance is being created. + CREATING = 3 + + # The instance is being deleted. + DELETING = 4 + + # The creation of the instance failed or a fatal error occurred during + # an operation on the instance or a batch of instances. + FAILED = 5 + + # The instance was created successfully, but was rolled back and deleted + # due to some other failure during BatchCreateInstances operation. + ROLLED_BACK = 6 + end + end + + # Message for updating a Instance + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Instance 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] instance + # @return [::Google::Cloud::AlloyDB::V1beta::Instance] + # 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set to true, update succeeds even if instance is not found. In + # that case, a new instance is created and `update_mask` is ignored. + class UpdateInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Instance + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] etag + # @return [::String] + # Optional. The current etag of the Instance. + # If an etag is provided and does not match the current etag of the Instance, + # deletion will be blocked and an ABORTED error will be returned. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class DeleteInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for triggering failover on an Instance + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class FailoverInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for triggering fault injection on an instance + # @!attribute [rw] fault_type + # @return [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest::FaultType] + # Required. The type of fault to be injected in an instance. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + class InjectFaultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # FaultType contains all valid types of faults that can be injected to an + # instance. + module FaultType + # The fault type is unknown. + FAULT_TYPE_UNSPECIFIED = 0 + + # Stop the VM + STOP_VM = 1 + end + end + + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the Instance.name field. + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, performs request validation, for example, permission + # checks and any other type of validation, but does not actually execute the + # create request. + # @!attribute [rw] node_ids + # @return [::Array<::String>] + # Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to + # restart upon. Applicable only to read instances. + class RestartInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for ExecuteSql rpc. + # @!attribute [rw] password + # @return [::String] + # Optional. The database native user’s password. + # @!attribute [rw] instance + # @return [::String] + # Required. The instance where the SQL will be executed. For the required + # format, see the comment on the Instance.name field. + # @!attribute [rw] database + # @return [::String] + # Required. Name of the database where the query will be executed. + # Note - Value provided should be the same as expected from `SELECT + # current_database();` and NOT as a resource reference. + # @!attribute [rw] user + # @return [::String] + # Required. Database user to be used for executing the SQL. + # Note - Value provided should be the same as expected from + # `SELECT current_user;` and NOT as a resource reference. + # @!attribute [rw] sql_statement + # @return [::String] + # Required. SQL statement to execute on database. Any valid statement is + # permitted, including DDL, DML, DQL statements. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validates the sql statement by performing + # syntax and semantic validation and doesn't execute the query. + class ExecuteSqlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Execute a SQL statement response. + # @!attribute [rw] sql_results + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SqlResult>] + # SqlResult represents the results for the execution of sql statements. + # @!attribute [rw] metadata + # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlMetadata] + # Any additional metadata information regarding the execution of the sql + # statement. + class ExecuteSqlResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Any additional metadata information regarding the execution of the SQL + # @!attribute [rw] message + # @return [::String] + # Message related to SQL execution. Marked as core content since it + # can potentially contain details related to the query or result set. This + # field can be used to convey messages such as "when the SQL result set + # exceeds the acceptable response size limits." + # @!attribute [rw] partial_result + # @return [::Boolean] + # Set to true if SQL returned a result set larger than the acceptable + # response size limits and the result was truncated. + # @!attribute [rw] sql_statement_execution_duration + # @return [::Google::Protobuf::Duration] + # The time duration taken to execute the sql statement. + # @!attribute [rw] status + # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlMetadata::Status] + # Status of SQL execution. + class ExecuteSqlMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Status contains all valid Status a SQL execution can end up in. + module Status + # The status is unknown. + STATUS_UNSPECIFIED = 0 + + # No error during SQL execution i.e. All SQL statements ran to completion. + # The "message" will be empty. + OK = 1 + + # Same as OK, except indicates that only partial results were + # returned. The "message" field will contain details on why results were + # truncated. + PARTIAL = 2 + + # Error during SQL execution. Atleast 1 SQL statement execution resulted in + # a error. Side effects of other statements are rolled back. The "message" + # field will contain human readable error given by Postgres of the first + # bad SQL statement. SQL execution errors don't constitute API errors as + # defined in https://google.aip.dev/193 but will be returned as part of + # this message. + ERROR = 3 + end + end + + # Message for requesting list of Backups + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListBackupsRequest + # @!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 ListBackupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Backups + # @!attribute [rw] backups + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Backup>] + # The list of Backup + # @!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 ListBackupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Backup + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + class GetBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Backup + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] backup_id + # @return [::String] + # Required. ID of the requesting object. + # @!attribute [rw] backup + # @return [::Google::Cloud::AlloyDB::V1beta::Backup] + # 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + class CreateBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Backup + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Backup 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] backup + # @return [::Google::Cloud::AlloyDB::V1beta::Backup] + # 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set to true, update succeeds even if instance is not found. In + # that case, a new backup is created and `update_mask` is ignored. + class UpdateBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Backup + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. For the required format, see the comment on + # the Backup.name field. + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @!attribute [rw] etag + # @return [::String] + # Optional. The current etag of the Backup. + # If an etag is provided and does not match the current etag of the Backup, + # deletion will be blocked and an ABORTED error will be returned. + class DeleteBackupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for listing the information about the supported Database flags. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. The required format is: + # * projects/\\{project}/locations/\\{location} + # + # Regardless of the parent specified here, as long it is contains a valid + # project and location, the service will return a static list of supported + # flags resources. Note that we do not yet support region-specific + # flags. + # @!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] scope + # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::Scope] + # Optional. The scope for which supported flags are requested. If not + # specified, default is DATABASE. + class ListSupportedDatabaseFlagsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing SupportedDatabaseFlags. + # @!attribute [rw] supported_database_flags + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] + # The list of SupportedDatabaseFlags. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListSupportedDatabaseFlagsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requests to generate a client certificate signed by the Cluster + # CA. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. The required format is: + # * projects/\\{project}/locations/\\{location}/clusters/\\{cluster} + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] pem_csr + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. A pem-encoded X.509 certificate signing request (CSR). It is + # recommended to use public_key instead. + # @!attribute [rw] cert_duration + # @return [::Google::Protobuf::Duration] + # Optional. An optional hint to the endpoint to generate the client + # certificate with the requested duration. The duration can be from 1 hour to + # 24 hours. The endpoint may or may not honor the hint. If the hint is left + # unspecified or is not honored, then the endpoint will pick an appropriate + # default duration. + # @!attribute [rw] public_key + # @return [::String] + # Optional. The public key from the client. + # @!attribute [rw] use_metadata_exchange + # @return [::Boolean] + # Optional. An optional hint to the endpoint to generate a client certificate + # that can be used by AlloyDB connectors to exchange additional metadata with + # the server after TLS handshake. + class GenerateClientCertificateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned by a GenerateClientCertificate operation. + # @!attribute [r] pem_certificate + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Output only. The pem-encoded, signed X.509 certificate. + # @!attribute [r] pem_certificate_chain + # @return [::Array<::String>] + # Output only. The pem-encoded chain that may be used to verify the X.509 + # certificate. Expected to be in issuer-to-root order according to RFC 5246. + # @!attribute [rw] ca_cert + # @return [::String] + # Optional. The pem-encoded cluster ca X.509 certificate. + class GenerateClientCertificateResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetConnectionInfo. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the parent resource. The required format is: + # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance} + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating 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 GetConnectionInfoRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] batch_create_instances_metadata + # @return [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesMetadata] + # Output only. BatchCreateInstances related metadata. + # + # Note: The following fields are mutually exclusive: `batch_create_instances_metadata`, `promote_cluster_status`, `upgrade_cluster_status`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] promote_cluster_status + # @return [::Google::Cloud::AlloyDB::V1beta::PromoteClusterStatus] + # Output only. PromoteClusterStatus related metadata. + # + # Note: The following fields are mutually exclusive: `promote_cluster_status`, `batch_create_instances_metadata`, `upgrade_cluster_status`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] upgrade_cluster_status + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus] + # Output only. UpgradeClusterStatus related metadata. + # + # Note: The following fields are mutually exclusive: `upgrade_cluster_status`, `batch_create_instances_metadata`, `promote_cluster_status`. 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 the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have + # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} + # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for current status of the database during Promote Cluster operation. + # @!attribute [r] state + # @return [::Google::Cloud::AlloyDB::V1beta::PromoteClusterStatus::State] + # Output only. The current state of the promoted secondary's database. + # Once the operation is complete, the final state of the database in the + # LRO can be one of: + # 1. PROMOTE_CLUSTER_AVAILABLE_FOR_READ, indicating that the promote + # operation has failed mid-way, the database is still only available for + # read. + # 2. PROMOTE_CLUSTER_COMPLETED, indicating that a promote operation + # completed successfully. The database is available for both read and write + # requests + class PromoteClusterStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State contains all valid states of the database during promote cluster + # operation. This is used for status reporting through the LRO metadata. + module State + # The state of the database is unknown. + STATE_UNSPECIFIED = 0 + + # The database is only available for read. + PROMOTE_CLUSTER_AVAILABLE_FOR_READ = 1 + + # The database is available for both read and write. The promote operation + # is near completion. + PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE = 2 + + # The promote operation is completed and the database is available for + # write. + PROMOTE_CLUSTER_COMPLETED = 3 + end + end + + # Message for current status of the Major Version Upgrade operation. + # @!attribute [rw] state + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] + # Cluster Major Version Upgrade state. + # @!attribute [rw] cancellable + # @return [::Boolean] + # Whether the operation is cancellable. + # @!attribute [rw] source_version + # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] + # Source database major version. + # @!attribute [rw] target_version + # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] + # Target database major version. + # @!attribute [rw] stages + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus::StageStatus>] + # Status of all upgrade stages. + class UpgradeClusterStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Status of an upgrade stage. + # @!attribute [rw] read_pool_instances_upgrade + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus::ReadPoolInstancesUpgradeStageStatus] + # Read pool instances upgrade metadata. + # @!attribute [rw] stage + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Stage] + # Upgrade stage. + # @!attribute [rw] state + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] + # State of this stage. + # @!attribute [r] schedule + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus::StageStatus::StageSchedule] + # Output only. Timing information for the stage execution. + class StageStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Timing information for the stage execution. + # @!attribute [rw] estimated_start_time + # @return [::Google::Protobuf::Timestamp] + # When the stage is expected to start. Set only if the stage has not + # started yet. + # @!attribute [rw] actual_start_time + # @return [::Google::Protobuf::Timestamp] + # Actual start time of the stage. Set only if the stage has started. + # @!attribute [rw] estimated_end_time + # @return [::Google::Protobuf::Timestamp] + # When the stage is expected to end. Set only if the stage has not + # completed yet. + # @!attribute [rw] actual_end_time + # @return [::Google::Protobuf::Timestamp] + # Actual end time of the stage. Set only if the stage has completed. + class StageSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Read pool instances upgrade specific status. + # @!attribute [rw] upgrade_stats + # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus::ReadPoolInstancesUpgradeStageStatus::Stats] + # Read pool instances upgrade statistics. + class ReadPoolInstancesUpgradeStageStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Upgrade stats for read pool instances. + # @!attribute [rw] not_started + # @return [::Integer] + # Number of read pool instances for which upgrade has not started. + # @!attribute [rw] ongoing + # @return [::Integer] + # Number of read pool instances undergoing upgrade. + # @!attribute [rw] success + # @return [::Integer] + # Number of read pool instances successfully upgraded. + # @!attribute [rw] failed + # @return [::Integer] + # Number of read pool instances which failed to upgrade. + class Stats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Message for requesting list of Users + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListUsersRequest + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Optional. Hint for how to order the results + class ListUsersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Users + # @!attribute [rw] users + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::User>] + # The list of User + # @!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 ListUsersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a User + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the User.name field. + class GetUserRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a User + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] user_id + # @return [::String] + # Required. ID of the requesting object. + # @!attribute [rw] user + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + class CreateUserRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a User + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # User 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] user + # @return [::Google::Cloud::AlloyDB::V1beta::User] + # 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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. Allow missing fields in the update mask. + class UpdateUserRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a User + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource. For the required format, see the + # comment on the User.name field. + # @!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 ignores the + # request if it has already been completed. The server guarantees that for at + # least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, ignores the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, the backend validates the request, but doesn't actually + # execute it. + class DeleteUserRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for ListDatabases request. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListDatabasesRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of databases to return. The service may return + # fewer than this value. If unspecified, 2000 is the default page_size. The + # max value of page_size will be 4000, values above max will be coerced to + # max. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListDatabases` call. + # This should be provided to retrieve the subsequent page. + # This field is currently not supported, its value will be ignored if passed. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering results. + # This field is currently not supported, its value will be ignored if passed. + class ListDatabasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for ListDatabases response. + # @!attribute [rw] databases + # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Database>] + # The list of databases. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying the next page of results the server should return. + # If this field is omitted, there are no subsequent pages. + class ListDatabasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for CreateDatabase request. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] database_id + # @return [::String] + # Required. ID of the requesting object. + # @!attribute [rw] database + # @return [::Google::Cloud::AlloyDB::V1beta::Database] + # Required. The resource being created. + class CreateDatabaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..f2d9d79d9da4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..9e9bdbb09ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..341efa296c29 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..c2acab1235a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..ad3c3ad25f0f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..a005f395ccab --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..54bd4318d321 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..3f61f95b2587 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/date.rb new file mode 100644 index 000000000000..2f4a77319e09 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/date.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..c271eea096ba --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..9505eeb8657e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..842b79be8a96 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/timeofday.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +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-alloy_db-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/Gemfile new file mode 100644 index 000000000000..f9832e65f5bc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-alloy_db-v1beta", path: "../" +else + gem "google-cloud-alloy_db-v1beta" +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-alloy_db-v1beta/snippets/alloy_db_admin/batch_create_instances.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/batch_create_instances.rb new file mode 100644 index 000000000000..a70279ec328a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/batch_create_instances.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the batch_create_instances call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#batch_create_instances. +# +def batch_create_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new + + # Call the batch_create_instances method. + result = client.batch_create_instances request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_backup.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_backup.rb new file mode 100644 index 000000000000..681d2376051d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the create_backup call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_backup. +# +def create_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::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 alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_cluster.rb new file mode 100644 index 000000000000..415c4db156d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the create_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_cluster. +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new + + # Call the create_cluster method. + result = client.create_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_database.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_database.rb new file mode 100644 index 000000000000..7252a3391b23 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_database.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the create_database call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_database. +# +def create_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new + + # Call the create_database method. + result = client.create_database request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::Database. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_instance.rb new file mode 100644 index 000000000000..ada47ffb7fa9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the create_instance call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_instance. +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::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 alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_cluster.rb new file mode 100644 index 000000000000..9d350de6a6a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the create_secondary_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_cluster. +# +def create_secondary_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new + + # Call the create_secondary_cluster method. + result = client.create_secondary_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_instance.rb new file mode 100644 index 000000000000..9f5afe6abf31 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the create_secondary_instance call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_instance. +# +def create_secondary_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new + + # Call the create_secondary_instance method. + result = client.create_secondary_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 alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_user.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_user.rb new file mode 100644 index 000000000000..13a47099c7dc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_user.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the create_user call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_user. +# +def create_user + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new + + # Call the create_user method. + result = client.create_user request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_backup.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_backup.rb new file mode 100644 index 000000000000..b37c9ca0ff30 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the delete_backup call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_backup. +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new + + # Call the delete_backup method. + result = client.delete_backup request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_cluster.rb new file mode 100644 index 000000000000..f0a18d5b54f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the delete_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_cluster. +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new + + # Call the delete_cluster method. + result = client.delete_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_instance.rb new file mode 100644 index 000000000000..a82b5b9bc216 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the delete_instance call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_instance. +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new + + # Call the delete_instance method. + result = client.delete_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_user.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_user.rb new file mode 100644 index 000000000000..ecd93e4b526b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_user.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the delete_user call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_user. +# +def delete_user + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new + + # Call the delete_user method. + result = client.delete_user request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/execute_sql.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/execute_sql.rb new file mode 100644 index 000000000000..c0df27e85b07 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/execute_sql.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the execute_sql call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#execute_sql. +# +def execute_sql + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new + + # Call the execute_sql method. + result = client.execute_sql request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/export_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/export_cluster.rb new file mode 100644 index 000000000000..61cbc03dd066 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/export_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the export_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#export_cluster. +# +def export_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new + + # Call the export_cluster method. + result = client.export_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/failover_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/failover_instance.rb new file mode 100644 index 000000000000..33e174236516 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/failover_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the failover_instance call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#failover_instance. +# +def failover_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new + + # Call the failover_instance method. + result = client.failover_instance request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/generate_client_certificate.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/generate_client_certificate.rb new file mode 100644 index 000000000000..63105e278149 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/generate_client_certificate.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the generate_client_certificate call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#generate_client_certificate. +# +def generate_client_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new + + # Call the generate_client_certificate method. + result = client.generate_client_certificate request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_backup.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_backup.rb new file mode 100644 index 000000000000..0c656bbd553d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_backup.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the get_backup call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_backup. +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::GetBackupRequest.new + + # Call the get_backup method. + result = client.get_backup request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::Backup. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_cluster.rb new file mode 100644 index 000000000000..57a2cceb3a40 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_cluster.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the get_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_cluster. +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new + + # Call the get_cluster method. + result = client.get_cluster request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::Cluster. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_connection_info.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_connection_info.rb new file mode 100644 index 000000000000..35d7fefaea44 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_connection_info.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the get_connection_info call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_connection_info. +# +def get_connection_info + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new + + # Call the get_connection_info method. + result = client.get_connection_info request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::ConnectionInfo. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_instance.rb new file mode 100644 index 000000000000..faf012d1f243 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_instance.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the get_instance call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_instance. +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new + + # Call the get_instance method. + result = client.get_instance request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::Instance. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_user.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_user.rb new file mode 100644 index 000000000000..dfa487141659 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_user.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the get_user call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_user. +# +def get_user + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::GetUserRequest.new + + # Call the get_user method. + result = client.get_user request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/import_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/import_cluster.rb new file mode 100644 index 000000000000..f89cca0004be --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/import_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the import_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#import_cluster. +# +def import_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new + + # Call the import_cluster method. + result = client.import_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/inject_fault.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/inject_fault.rb new file mode 100644 index 000000000000..b91c8d2344f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/inject_fault.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the inject_fault call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#inject_fault. +# +def inject_fault + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new + + # Call the inject_fault method. + result = client.inject_fault request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_backups.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_backups.rb new file mode 100644 index 000000000000..93370f877a95 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_backups.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the list_backups call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_backups. +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Backup. + p item + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_clusters.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_clusters.rb new file mode 100644 index 000000000000..46132eccd659 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_clusters.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the list_clusters call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_clusters. +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::ListClustersRequest.new + + # Call the list_clusters method. + result = client.list_clusters request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::AlloyDB::V1beta::Cluster. + p item + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_databases.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_databases.rb new file mode 100644 index 000000000000..c6e8bfd45232 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_databases.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the list_databases call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_databases. +# +def list_databases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Database. + p item + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_instances.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_instances.rb new file mode 100644 index 000000000000..a4eb8da5419c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_instances.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the list_instances call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_instances. +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Instance. + p item + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_supported_database_flags.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_supported_database_flags.rb new file mode 100644 index 000000000000..948612733d08 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_supported_database_flags.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the list_supported_database_flags call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_supported_database_flags. +# +def list_supported_database_flags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new + + # Call the list_supported_database_flags method. + result = client.list_supported_database_flags request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag. + p item + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_users.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_users.rb new file mode 100644 index 000000000000..3d1cc2222566 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_users.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the list_users call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_users. +# +def list_users + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::ListUsersRequest.new + + # Call the list_users method. + result = client.list_users request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::AlloyDB::V1beta::User. + p item + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/promote_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/promote_cluster.rb new file mode 100644 index 000000000000..3bfcce902eaf --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/promote_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the promote_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#promote_cluster. +# +def promote_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new + + # Call the promote_cluster method. + result = client.promote_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restart_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restart_instance.rb new file mode 100644 index 000000000000..e6152e02dadc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restart_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the restart_instance call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restart_instance. +# +def restart_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new + + # Call the restart_instance method. + result = client.restart_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 alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restore_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restore_cluster.rb new file mode 100644 index 000000000000..8c4782f0f0d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restore_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the restore_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restore_cluster. +# +def restore_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new + + # Call the restore_cluster method. + result = client.restore_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/switchover_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/switchover_cluster.rb new file mode 100644 index 000000000000..d20ead6d7e68 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/switchover_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the switchover_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#switchover_cluster. +# +def switchover_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new + + # Call the switchover_cluster method. + result = client.switchover_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_backup.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_backup.rb new file mode 100644 index 000000000000..2852a2e5fb86 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_backup.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the update_backup call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_backup. +# +def update_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new + + # Call the update_backup method. + result = client.update_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 alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_cluster.rb new file mode 100644 index 000000000000..7199ebdb1af7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the update_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_cluster. +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new + + # Call the update_cluster method. + result = client.update_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_instance.rb new file mode 100644 index 000000000000..b1fe3cbba369 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_instance.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the update_instance call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_instance. +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::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 alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_user.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_user.rb new file mode 100644 index 000000000000..41d4cd207c59 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_user.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the update_user call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_user. +# +def update_user + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new + + # Call the update_user method. + result = client.update_user request + + # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. + p result +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/upgrade_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/upgrade_cluster.rb new file mode 100644 index 000000000000..49fd373c8882 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/upgrade_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the upgrade_cluster call in the AlloyDBAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#upgrade_cluster. +# +def upgrade_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new + + # Call the upgrade_cluster method. + result = client.upgrade_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb new file mode 100644 index 000000000000..2bad2da7e8ab --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START alloydb_v1beta_generated_AlloyDBCloudSQLAdmin_RestoreFromCloudSQL_sync] +require "google/cloud/alloy_db/v1beta" + +## +# Snippet for the restore_from_cloud_sql call in the AlloyDBCloudSQLAdmin service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client#restore_from_cloud_sql. +# +def restore_from_cloud_sql + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new + + # Call the restore_from_cloud_sql method. + result = client.restore_from_cloud_sql request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END alloydb_v1beta_generated_AlloyDBCloudSQLAdmin_RestoreFromCloudSQL_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/snippet_metadata_google.cloud.alloydb.v1beta.json b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/snippet_metadata_google.cloud.alloydb.v1beta.json new file mode 100644 index 000000000000..ae3fb3fc03bf --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/snippet_metadata_google.cloud.alloydb.v1beta.json @@ -0,0 +1,1575 @@ +{ + "client_library": { + "name": "google-cloud-alloy_db-v1beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.alloydb.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync", + "title": "Snippet for the list_clusters call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_clusters.", + "file": "alloy_db_admin/list_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clusters", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ListClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::ListClustersResponse", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ListClusters", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClusters", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync", + "title": "Snippet for the get_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_cluster.", + "file": "alloy_db_admin/get_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::GetClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::Cluster", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "GetCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync", + "title": "Snippet for the create_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_cluster.", + "file": "alloy_db_admin/create_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "CreateCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync", + "title": "Snippet for the update_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_cluster.", + "file": "alloy_db_admin/update_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "UpdateCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_sync", + "title": "Snippet for the export_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#export_cluster.", + "file": "alloy_db_admin/export_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#export_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ExportCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_sync", + "title": "Snippet for the import_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#import_cluster.", + "file": "alloy_db_admin/import_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#import_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ImportCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_sync", + "title": "Snippet for the upgrade_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#upgrade_cluster.", + "file": "alloy_db_admin/upgrade_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "upgrade_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#upgrade_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "UpgradeCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync", + "title": "Snippet for the delete_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_cluster.", + "file": "alloy_db_admin/delete_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "DeleteCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync", + "title": "Snippet for the promote_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#promote_cluster.", + "file": "alloy_db_admin/promote_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "promote_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#promote_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "PromoteCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_sync", + "title": "Snippet for the switchover_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#switchover_cluster.", + "file": "alloy_db_admin/switchover_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "switchover_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#switchover_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "SwitchoverCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync", + "title": "Snippet for the restore_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restore_cluster.", + "file": "alloy_db_admin/restore_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restore_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "RestoreCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync", + "title": "Snippet for the create_secondary_cluster call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_cluster.", + "file": "alloy_db_admin/create_secondary_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_secondary_cluster", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "CreateSecondaryCluster", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryCluster", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync", + "title": "Snippet for the list_instances call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_instances.", + "file": "alloy_db_admin/list_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instances", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::ListInstancesResponse", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ListInstances", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstances", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync", + "title": "Snippet for the get_instance call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_instance.", + "file": "alloy_db_admin/get_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::Instance", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "GetInstance", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstance", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync", + "title": "Snippet for the create_instance call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_instance.", + "file": "alloy_db_admin/create_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_instance", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "CreateInstance", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstance", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync", + "title": "Snippet for the create_secondary_instance call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_instance.", + "file": "alloy_db_admin/create_secondary_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_secondary_instance", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "CreateSecondaryInstance", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstance", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync", + "title": "Snippet for the batch_create_instances call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#batch_create_instances.", + "file": "alloy_db_admin/batch_create_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_instances", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#batch_create_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "BatchCreateInstances", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstances", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync", + "title": "Snippet for the update_instance call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_instance.", + "file": "alloy_db_admin/update_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_instance", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "UpdateInstance", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstance", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync", + "title": "Snippet for the delete_instance call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_instance.", + "file": "alloy_db_admin/delete_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_instance", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "DeleteInstance", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstance", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync", + "title": "Snippet for the failover_instance call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#failover_instance.", + "file": "alloy_db_admin/failover_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "failover_instance", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#failover_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "FailoverInstance", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstance", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync", + "title": "Snippet for the inject_fault call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#inject_fault.", + "file": "alloy_db_admin/inject_fault.rb", + "language": "RUBY", + "client_method": { + "short_name": "inject_fault", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#inject_fault", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "InjectFault", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFault", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync", + "title": "Snippet for the restart_instance call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restart_instance.", + "file": "alloy_db_admin/restart_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "restart_instance", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restart_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "RestartInstance", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstance", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_sync", + "title": "Snippet for the execute_sql call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#execute_sql.", + "file": "alloy_db_admin/execute_sql.rb", + "language": "RUBY", + "client_method": { + "short_name": "execute_sql", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#execute_sql", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ExecuteSql", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSql", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync", + "title": "Snippet for the list_backups call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_backups.", + "file": "alloy_db_admin/list_backups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_backups", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_backups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::ListBackupsResponse", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ListBackups", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackups", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync", + "title": "Snippet for the get_backup call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_backup.", + "file": "alloy_db_admin/get_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_backup", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::GetBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::Backup", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "GetBackup", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackup", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync", + "title": "Snippet for the create_backup call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_backup.", + "file": "alloy_db_admin/create_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_backup", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "CreateBackup", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackup", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync", + "title": "Snippet for the update_backup call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_backup.", + "file": "alloy_db_admin/update_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_backup", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "UpdateBackup", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackup", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync", + "title": "Snippet for the delete_backup call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_backup.", + "file": "alloy_db_admin/delete_backup.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_backup", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_backup", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "DeleteBackup", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackup", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync", + "title": "Snippet for the list_supported_database_flags call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_supported_database_flags.", + "file": "alloy_db_admin/list_supported_database_flags.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_supported_database_flags", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_supported_database_flags", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ListSupportedDatabaseFlags", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlags", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync", + "title": "Snippet for the generate_client_certificate call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#generate_client_certificate.", + "file": "alloy_db_admin/generate_client_certificate.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_client_certificate", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#generate_client_certificate", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "GenerateClientCertificate", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificate", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync", + "title": "Snippet for the get_connection_info call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_connection_info.", + "file": "alloy_db_admin/get_connection_info.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_connection_info", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_connection_info", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::ConnectionInfo", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "GetConnectionInfo", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfo", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync", + "title": "Snippet for the list_users call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_users.", + "file": "alloy_db_admin/list_users.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_users", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_users", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ListUsersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::ListUsersResponse", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ListUsers", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsers", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync", + "title": "Snippet for the get_user call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_user.", + "file": "alloy_db_admin/get_user.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_user", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_user", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::GetUserRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::User", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "GetUser", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUser", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync", + "title": "Snippet for the create_user call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_user.", + "file": "alloy_db_admin/create_user.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_user", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_user", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::CreateUserRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::User", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "CreateUser", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUser", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync", + "title": "Snippet for the update_user call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_user.", + "file": "alloy_db_admin/update_user.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_user", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_user", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::User", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "UpdateUser", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUser", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync", + "title": "Snippet for the delete_user call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_user.", + "file": "alloy_db_admin/delete_user.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_user", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_user", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "DeleteUser", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUser", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_sync", + "title": "Snippet for the list_databases call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_databases.", + "file": "alloy_db_admin/list_databases.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_databases", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_databases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::ListDatabasesResponse", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "ListDatabases", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabases", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_sync", + "title": "Snippet for the create_database call in the AlloyDBAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_database.", + "file": "alloy_db_admin/create_database.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_database", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_database", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::AlloyDB::V1beta::Database", + "client": { + "short_name": "AlloyDBAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" + }, + "method": { + "short_name": "CreateDatabase", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabase", + "service": { + "short_name": "AlloyDBAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "alloydb_v1beta_generated_AlloyDBCloudSQLAdmin_RestoreFromCloudSQL_sync", + "title": "Snippet for the restore_from_cloud_sql call in the AlloyDBCloudSQLAdmin service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client#restore_from_cloud_sql.", + "file": "alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_from_cloud_sql", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client#restore_from_cloud_sql", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AlloyDBCloudSQLAdmin::Client", + "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client" + }, + "method": { + "short_name": "RestoreFromCloudSQL", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQL", + "service": { + "short_name": "AlloyDBCloudSQLAdmin", + "full_name": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin" + } + } + }, + "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-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb new file mode 100644 index 000000000000..06818ae7bdbc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/alloydb/v1beta/service_pb" +require "google/cloud/alloydb/v1beta/service_services_pb" +require "google/cloud/alloy_db/v1beta/alloy_db_admin" + +class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb new file mode 100644 index 000000000000..79f3d0c8a4c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/alloy_db/v1beta/alloy_db_admin" + +class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backup: "value2" + assert_equal "projects/value0/locations/value1/backups/value2", path + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.database_path project: "value0", location: "value1", cluster: "value2", database: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/databases/value3", path + end + end + + def test_instance_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", cluster: "value2", instance: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/instances/value3", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/global/networks/value1", path + end + end + + def test_service_attachment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" + assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path + end + end + + def test_user_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.user_path project: "value0", location: "value1", cluster: "value2", user: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/users/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb new file mode 100644 index 000000000000..76e43428f0ca --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb @@ -0,0 +1,2271 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/alloydb/v1beta/service_pb" +require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" + + +class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_clusters + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::ListClustersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_clusters parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_clusters ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.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_clusters_client_stub.call_count + end + end + end + + def test_get_cluster + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::Cluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :CLUSTER_VIEW_UNSPECIFIED + + get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_count + end + end + end + + def test_create_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + validate_only = true + + create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_count + end + end + end + + def test_update_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + cluster = {} + request_id = "hello world" + validate_only = true + allow_missing = true + + update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_count + end + end + end + + def test_export_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + gcs_destination = {} + csv_export_options = {} + name = "hello world" + database = "hello world" + + export_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_export_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.export_cluster({ gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.export_cluster gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.export_cluster ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new(gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.export_cluster({ gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.export_cluster(::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new(gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_cluster_client_stub.call_count + end + end + end + + def test_import_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + sql_import_options = {} + name = "hello world" + gcs_uri = "hello world" + database = "hello world" + user = "hello world" + + import_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_import_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_cluster({ sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_cluster sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_cluster ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new(sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_cluster({ sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_cluster(::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new(sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_cluster_client_stub.call_count + end + end + end + + def test_upgrade_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + version = :DATABASE_VERSION_UNSPECIFIED + request_id = "hello world" + validate_only = true + etag = "hello world" + + upgrade_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_upgrade_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, upgrade_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.upgrade_cluster({ name: name, version: version, request_id: request_id, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.upgrade_cluster name: name, version: version, request_id: request_id, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.upgrade_cluster ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new(name: name, version: version, request_id: request_id, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.upgrade_cluster({ name: name, version: version, request_id: request_id, 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.upgrade_cluster(::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new(name: name, version: version, request_id: request_id, 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, upgrade_cluster_client_stub.call_count + end + end + end + + def test_delete_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + etag = "hello world" + validate_only = true + force = true + + delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_count + end + end + end + + def test_promote_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + etag = "hello world" + validate_only = true + + promote_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_promote_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, promote_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.promote_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.promote_cluster name: name, request_id: request_id, etag: etag, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.promote_cluster ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.promote_cluster({ name: name, request_id: request_id, 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.promote_cluster(::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new(name: name, request_id: request_id, 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, promote_cluster_client_stub.call_count + end + end + end + + def test_switchover_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + validate_only = true + + switchover_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_switchover_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, switchover_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.switchover_cluster({ name: name, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.switchover_cluster name: name, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.switchover_cluster ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new(name: name, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.switchover_cluster({ name: name, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.switchover_cluster(::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new(name: name, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, switchover_cluster_client_stub.call_count + end + end + end + + def test_restore_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + backup_source = {} + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + validate_only = true + + restore_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_restore_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_cluster({ backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_cluster backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_cluster ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new(backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_cluster({ backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_cluster(::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new(backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_cluster_client_stub.call_count + end + end + end + + def test_create_secondary_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + validate_only = true + + create_secondary_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_secondary_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_secondary_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_secondary_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_secondary_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_secondary_cluster ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_secondary_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_secondary_cluster(::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_secondary_cluster_client_stub.call_count + end + end + end + + def test_list_instances + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::ListInstancesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_instances ::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_instances(::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_instances_client_stub.call_count + end + end + end + + def test_get_instance + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::Instance.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :INSTANCE_VIEW_UNSPECIFIED + + 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance ::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_count + end + end + end + + def test_create_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_id = "hello world" + instance = {} + request_id = "hello world" + validate_only = true + + 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_instance ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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(::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_client_stub.call_count + end + end + end + + def test_create_secondary_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_id = "hello world" + instance = {} + request_id = "hello world" + validate_only = true + + create_secondary_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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_secondary_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_secondary_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_secondary_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_secondary_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_secondary_instance ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_secondary_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_secondary_instance(::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_secondary_instance_client_stub.call_count + end + end + end + + def test_batch_create_instances + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + requests = {} + request_id = "hello world" + + batch_create_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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_batch_create_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_instances_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_create_instances({ parent: parent, requests: requests, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_create_instances parent: parent, requests: requests, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_create_instances ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new(parent: parent, requests: requests, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_create_instances({ parent: parent, requests: requests, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_create_instances(::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new(parent: parent, requests: requests, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_instances_client_stub.call_count + end + end + end + + def test_update_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + instance = {} + request_id = "hello world" + validate_only = true + allow_missing = true + + 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_instance update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_instance ::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_instance(::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), 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::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" + etag = "hello world" + validate_only = true + + 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_instance({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_instance name: name, request_id: request_id, etag: etag, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new(name: name, request_id: request_id, 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({ name: name, request_id: request_id, 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(::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new(name: name, request_id: request_id, 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_client_stub.call_count + end + end + end + + def test_failover_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + validate_only = true + + failover_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_failover_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, failover_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.failover_instance({ name: name, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.failover_instance name: name, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.failover_instance ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.failover_instance({ name: name, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.failover_instance(::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, failover_instance_client_stub.call_count + end + end + end + + def test_inject_fault + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + fault_type = :FAULT_TYPE_UNSPECIFIED + name = "hello world" + request_id = "hello world" + validate_only = true + + inject_fault_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_inject_fault_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, inject_fault_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.inject_fault({ fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.inject_fault fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.inject_fault ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new(fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.inject_fault({ fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.inject_fault(::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new(fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, inject_fault_client_stub.call_count + end + end + end + + def test_restart_instance + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + validate_only = true + node_ids = ["hello world"] + + restart_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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_restart_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restart_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restart_instance({ name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restart_instance name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restart_instance ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restart_instance({ name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restart_instance(::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restart_instance_client_stub.call_count + end + end + end + + def test_execute_sql + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + password = "hello world" + instance = "hello world" + database = "hello world" + user = "hello world" + sql_statement = "hello world" + validate_only = true + + execute_sql_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_execute_sql_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, execute_sql_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.execute_sql({ password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.execute_sql password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.execute_sql ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new(password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.execute_sql({ password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.execute_sql(::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new(password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, execute_sql_client_stub.call_count + end + end + end + + def test_list_backups + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::ListBackupsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_backups parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_backups ::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest.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_backups({ 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_backups(::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest.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_backups_client_stub.call_count + end + end + end + + def test_get_backup + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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_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 = {} + request_id = "hello world" + validate_only = true + + 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_backup_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, validate_only: validate_only }) 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, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_backup ::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, validate_only: validate_only) 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, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_backup(::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, validate_only: validate_only), 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_update_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. + update_mask = {} + backup = {} + request_id = "hello world" + validate_only = true + allow_missing = true + + 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_update_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_backup_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_backup update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_backup ::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_backup(::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), 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::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" + validate_only = true + etag = "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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_count + end + end + end + + def test_list_supported_database_flags + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + scope = :SCOPE_UNSPECIFIED + + list_supported_database_flags_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_supported_database_flags_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_supported_database_flags_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_supported_database_flags({ parent: parent, page_size: page_size, page_token: page_token, scope: scope }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_supported_database_flags parent: parent, page_size: page_size, page_token: page_token, scope: scope do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_supported_database_flags ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new(parent: parent, page_size: page_size, page_token: page_token, scope: scope) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_supported_database_flags({ parent: parent, page_size: page_size, page_token: page_token, scope: scope }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_supported_database_flags(::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new(parent: parent, page_size: page_size, page_token: page_token, scope: scope), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_supported_database_flags_client_stub.call_count + end + end + end + + def test_generate_client_certificate + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + request_id = "hello world" + pem_csr = "hello world" + cert_duration = {} + public_key = "hello world" + use_metadata_exchange = true + + generate_client_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_generate_client_certificate_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_client_certificate_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_client_certificate({ parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_client_certificate parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_client_certificate ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new(parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_client_certificate({ parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_client_certificate(::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new(parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_client_certificate_client_stub.call_count + end + end + end + + def test_get_connection_info + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::ConnectionInfo.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + request_id = "hello world" + + get_connection_info_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_connection_info_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_connection_info_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_connection_info({ parent: parent, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_connection_info parent: parent, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_connection_info ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new(parent: parent, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_connection_info({ parent: parent, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_connection_info(::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new(parent: parent, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_connection_info_client_stub.call_count + end + end + end + + def test_list_users + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::ListUsersResponse.new + http_response = OpenStruct.new 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_users_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_users_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_users_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_users({ parent: parent, page_size: 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_users parent: parent, page_size: 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_users ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest.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_users({ 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_users(::Google::Cloud::AlloyDB::V1beta::ListUsersRequest.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_users_client_stub.call_count + end + end + end + + def test_get_user + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::User.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_user_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_user_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_user({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_user name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_user ::Google::Cloud::AlloyDB::V1beta::GetUserRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_user({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_user(::Google::Cloud::AlloyDB::V1beta::GetUserRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_user_client_stub.call_count + end + end + end + + def test_create_user + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::User.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + user_id = "hello world" + user = {} + request_id = "hello world" + validate_only = true + + create_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_user_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_user_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_user({ parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_user parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_user ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new(parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_user({ parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_user(::Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new(parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_user_client_stub.call_count + end + end + end + + def test_update_user + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::User.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + update_mask = {} + user = {} + request_id = "hello world" + validate_only = true + allow_missing = true + + update_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_update_user_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_user_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_user({ update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_user update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_user ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new(update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_user({ update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_user(::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new(update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_user_client_stub.call_count + end + end + end + + def test_delete_user + # 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" + validate_only = true + + delete_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_delete_user_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_user_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_user({ name: name, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_user name: name, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_user ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new(name: name, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_user({ name: name, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_user(::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new(name: name, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_user_client_stub.call_count + end + end + end + + def test_list_databases + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::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" + filter = "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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_databases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_databases_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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, filter: filter }) 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, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_databases ::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest.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_databases({ 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_databases(::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest.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_databases_client_stub.call_count + end + end + end + + def test_create_database + # Create test objects. + client_result = ::Google::Cloud::AlloyDB::V1beta::Database.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" + database = {} + + 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_database_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_database_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_database({ parent: parent, database_id: database_id, database: database }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_database parent: parent, database_id: database_id, database: database do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_database ::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new(parent: parent, database_id: database_id, database: database) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_database({ parent: parent, database_id: database_id, database: database }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_database(::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new(parent: parent, database_id: database_id, database: database), 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_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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb new file mode 100644 index 000000000000..e98c748e6747 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb @@ -0,0 +1,2702 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/alloydb/v1beta/service_pb" +require "google/cloud/alloy_db/v1beta/alloy_db_admin" + +class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListClustersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clusters, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest, 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_clusters_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_clusters parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_clusters ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.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_clusters_client_stub.call_rpc_count + end + end + + def test_get_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::Cluster.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :CLUSTER_VIEW_UNSPECIFIED + + get_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal :CLUSTER_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster({ name: name, 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_cluster(::Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new(name: name, 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_cluster_client_stub.call_rpc_count + end + end + + def test_create_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + validate_only = true + + create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster(::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster_client_stub.call_rpc_count + end + end + + def test_update_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + update_mask = {} + cluster = {} + request_id = "hello world" + validate_only = true + allow_missing = true + + update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_rpc_count + end + end + + def test_export_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + gcs_destination = {} + csv_export_options = {} + name = "hello world" + database = "hello world" + + export_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::GcsDestination), request["gcs_destination"] + assert_equal :gcs_destination, request.destination + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::CsvExportOptions), request["csv_export_options"] + assert_equal :csv_export_options, request.export_options + assert_equal "hello world", request["name"] + assert_equal "hello world", request["database"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.export_cluster({ gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.export_cluster gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.export_cluster ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new(gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.export_cluster({ gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.export_cluster(::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new(gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, export_cluster_client_stub.call_rpc_count + end + end + + def test_import_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + sql_import_options = {} + name = "hello world" + gcs_uri = "hello world" + database = "hello world" + user = "hello world" + + import_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::SqlImportOptions), request["sql_import_options"] + assert_equal :sql_import_options, request.import_options + assert_equal "hello world", request["name"] + assert_equal "hello world", request["gcs_uri"] + assert_equal "hello world", request["database"] + assert_equal "hello world", request["user"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_cluster({ sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.import_cluster sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.import_cluster ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new(sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.import_cluster({ sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.import_cluster(::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new(sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, import_cluster_client_stub.call_rpc_count + end + end + + def test_upgrade_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + version = :DATABASE_VERSION_UNSPECIFIED + request_id = "hello world" + validate_only = true + etag = "hello world" + + upgrade_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :upgrade_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal :DATABASE_VERSION_UNSPECIFIED, request["version"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, upgrade_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.upgrade_cluster({ name: name, version: version, request_id: request_id, 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.upgrade_cluster name: name, version: version, request_id: request_id, 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.upgrade_cluster ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new(name: name, version: version, request_id: request_id, 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.upgrade_cluster({ name: name, version: version, request_id: request_id, 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.upgrade_cluster(::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new(name: name, version: version, request_id: request_id, 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, upgrade_cluster_client_stub.call_rpc_count + end + end + + def test_delete_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + etag = "hello world" + validate_only = true + force = true + + delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_rpc_count + end + end + + def test_promote_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + etag = "hello world" + validate_only = true + + promote_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :promote_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, promote_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.promote_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.promote_cluster name: name, request_id: request_id, etag: etag, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.promote_cluster ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.promote_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.promote_cluster(::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, promote_cluster_client_stub.call_rpc_count + end + end + + def test_switchover_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + validate_only = true + + switchover_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :switchover_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, switchover_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.switchover_cluster({ name: name, request_id: request_id, 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.switchover_cluster name: name, request_id: request_id, 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.switchover_cluster ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new(name: name, request_id: request_id, 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.switchover_cluster({ name: name, request_id: request_id, 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.switchover_cluster(::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new(name: name, request_id: request_id, 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, switchover_cluster_client_stub.call_rpc_count + end + end + + def test_restore_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + backup_source = {} + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + validate_only = true + + restore_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::BackupSource), request["backup_source"] + assert_equal :backup_source, request.source + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_cluster({ backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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.restore_cluster backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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.restore_cluster ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new(backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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.restore_cluster({ backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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.restore_cluster(::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new(backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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, restore_cluster_client_stub.call_rpc_count + end + end + + def test_create_secondary_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + validate_only = true + + create_secondary_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_secondary_cluster, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_secondary_cluster_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_secondary_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster(::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster_client_stub.call_rpc_count + end + end + + def test_list_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListInstancesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instances, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_instances ::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_instances(::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_instances_client_stub.call_rpc_count + end + end + + def test_get_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::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" + view = :INSTANCE_VIEW_UNSPECIFIED + + get_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal :INSTANCE_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance ::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_instance({ name: name, 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_instance(::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new(name: name, 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_instance_client_stub.call_rpc_count + end + end + + def test_create_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_id = "hello world" + instance = {} + request_id = "hello world" + validate_only = true + + create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_instance, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Instance), request["instance"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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 parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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 ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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(::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_client_stub.call_rpc_count + end + end + + def test_create_secondary_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + instance_id = "hello world" + instance = {} + request_id = "hello world" + validate_only = true + + create_secondary_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_secondary_instance, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["instance_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Instance), request["instance"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_secondary_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_secondary_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance(::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance_client_stub.call_rpc_count + end + end + + def test_batch_create_instances + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + requests = {} + request_id = "hello world" + + batch_create_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_instances, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests), request["requests"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_instances_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_create_instances({ parent: parent, requests: requests, request_id: request_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.batch_create_instances parent: parent, requests: requests, request_id: request_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.batch_create_instances ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new(parent: parent, requests: requests, request_id: request_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.batch_create_instances({ parent: parent, requests: requests, 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.batch_create_instances(::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new(parent: parent, requests: requests, 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, batch_create_instances_client_stub.call_rpc_count + end + end + + def test_update_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + update_mask = {} + instance = {} + request_id = "hello world" + validate_only = true + allow_missing = true + + update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_instance, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Instance), request["instance"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_instance update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_instance ::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_instance(::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_instance_client_stub.call_rpc_count + end + end + + def test_delete_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + etag = "hello world" + validate_only = true + + delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_instance, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_instance({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_instance name: name, request_id: request_id, etag: etag, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_instance ::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_instance({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_instance(::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_instance_client_stub.call_rpc_count + end + end + + def test_failover_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + validate_only = true + + failover_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :failover_instance, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, failover_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.failover_instance({ name: name, request_id: request_id, 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.failover_instance name: name, request_id: request_id, 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.failover_instance ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new(name: name, request_id: request_id, 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.failover_instance({ name: name, request_id: request_id, 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.failover_instance(::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new(name: name, request_id: request_id, 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, failover_instance_client_stub.call_rpc_count + end + end + + def test_inject_fault + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + fault_type = :FAULT_TYPE_UNSPECIFIED + name = "hello world" + request_id = "hello world" + validate_only = true + + inject_fault_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :inject_fault, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest, request + assert_equal :FAULT_TYPE_UNSPECIFIED, request["fault_type"] + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, inject_fault_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.inject_fault({ fault_type: fault_type, name: name, request_id: request_id, 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.inject_fault fault_type: fault_type, name: name, request_id: request_id, 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.inject_fault ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new(fault_type: fault_type, name: name, request_id: request_id, 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.inject_fault({ fault_type: fault_type, name: name, request_id: request_id, 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.inject_fault(::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new(fault_type: fault_type, name: name, request_id: request_id, 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, inject_fault_client_stub.call_rpc_count + end + end + + def test_restart_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + validate_only = true + node_ids = ["hello world"] + + restart_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restart_instance, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal ["hello world"], request["node_ids"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restart_instance_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restart_instance({ name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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.restart_instance name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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.restart_instance ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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.restart_instance({ name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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.restart_instance(::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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, restart_instance_client_stub.call_rpc_count + end + end + + def test_execute_sql + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + password = "hello world" + instance = "hello world" + database = "hello world" + user = "hello world" + sql_statement = "hello world" + validate_only = true + + execute_sql_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :execute_sql, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest, request + assert_equal "hello world", request["password"] + assert_equal :password, request.user_credential + assert_equal "hello world", request["instance"] + assert_equal "hello world", request["database"] + assert_equal "hello world", request["user"] + assert_equal "hello world", request["sql_statement"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, execute_sql_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.execute_sql({ password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.execute_sql password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.execute_sql ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new(password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.execute_sql({ password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, 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.execute_sql(::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new(password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, 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, execute_sql_client_stub.call_rpc_count + end + end + + def test_list_backups + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListBackupsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "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::AlloyDB::V1beta::ListBackupsRequest, 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_backups_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_backups({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_backups parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_backups ::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest.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_backups({ 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_backups(::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest.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_backups_client_stub.call_rpc_count + end + end + + def test_get_backup + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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_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 = {} + request_id = "hello world" + validate_only = true + + create_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_backup, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["backup_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Backup), request["backup"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_backup_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup ::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup({ parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup(::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup_client_stub.call_rpc_count + end + end + + def test_update_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. + update_mask = {} + backup = {} + request_id = "hello world" + validate_only = true + allow_missing = true + + update_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_backup, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Backup), request["backup"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_backup_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_backup update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_backup ::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_backup(::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_backup_client_stub.call_rpc_count + end + end + + def test_delete_backup + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + validate_only = true + etag = "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::AlloyDB::V1beta::DeleteBackupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_backup_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_backup({ name: name, request_id: request_id, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_backup name: name, request_id: request_id, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_backup ::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_backup({ name: name, request_id: request_id, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_backup(::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_backup_client_stub.call_rpc_count + end + end + + def test_list_supported_database_flags + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + scope = :SCOPE_UNSPECIFIED + + list_supported_database_flags_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_supported_database_flags, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :SCOPE_UNSPECIFIED, request["scope"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_supported_database_flags_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_supported_database_flags({ parent: parent, page_size: page_size, page_token: page_token, scope: scope }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_supported_database_flags parent: parent, page_size: page_size, page_token: page_token, scope: scope do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_supported_database_flags ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new(parent: parent, page_size: page_size, page_token: page_token, scope: scope) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_supported_database_flags({ parent: parent, page_size: page_size, page_token: page_token, scope: scope }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_supported_database_flags(::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new(parent: parent, page_size: page_size, page_token: page_token, scope: scope), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_supported_database_flags_client_stub.call_rpc_count + end + end + + def test_generate_client_certificate + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + request_id = "hello world" + pem_csr = "hello world" + cert_duration = {} + public_key = "hello world" + use_metadata_exchange = true + + generate_client_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_client_certificate, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["request_id"] + assert_equal "hello world", request["pem_csr"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["cert_duration"] + assert_equal "hello world", request["public_key"] + assert_equal true, request["use_metadata_exchange"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_client_certificate_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_client_certificate({ parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_client_certificate parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_client_certificate ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new(parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_client_certificate({ parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_client_certificate(::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new(parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_client_certificate_client_stub.call_rpc_count + end + end + + def test_get_connection_info + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::ConnectionInfo.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + request_id = "hello world" + + get_connection_info_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_connection_info, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_connection_info_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_connection_info({ parent: parent, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_connection_info parent: parent, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_connection_info ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new(parent: parent, 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_connection_info({ parent: parent, 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_connection_info(::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new(parent: parent, 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_connection_info_client_stub.call_rpc_count + end + end + + def test_list_users + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListUsersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_users_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_users, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest, 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_users_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_users({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_users parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_users ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest.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_users({ 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_users(::Google::Cloud::AlloyDB::V1beta::ListUsersRequest.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_users_client_stub.call_rpc_count + end + end + + def test_get_user + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::User.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_user, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GetUserRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_user_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_user({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_user name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_user ::Google::Cloud::AlloyDB::V1beta::GetUserRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_user({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_user(::Google::Cloud::AlloyDB::V1beta::GetUserRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_user_client_stub.call_rpc_count + end + end + + def test_create_user + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::User.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + user_id = "hello world" + user = {} + request_id = "hello world" + validate_only = true + + create_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_user, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["user_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::User), request["user"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_user_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_user({ parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_user parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_user ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new(parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_user({ parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_user(::Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new(parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_user_client_stub.call_rpc_count + end + end + + def test_update_user + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::User.new + grpc_operation = GRPC::ActiveCall::Operation.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 = {} + user = {} + request_id = "hello world" + validate_only = true + allow_missing = true + + update_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_user, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::User), request["user"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_user_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_user({ update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_user update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_user ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new(update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_user({ update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_user(::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new(update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_user_client_stub.call_rpc_count + end + end + + def test_delete_user + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_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" + validate_only = true + + delete_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_user, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_user_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_user({ name: name, request_id: request_id, validate_only: validate_only }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_user name: name, request_id: request_id, validate_only: validate_only do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_user ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new(name: name, request_id: request_id, 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_user({ name: name, request_id: request_id, 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_user(::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new(name: name, request_id: request_id, 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_user_client_stub.call_rpc_count + end + end + + def test_list_databases + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::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" + filter = "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::AlloyDB::V1beta::ListDatabasesRequest, 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_databases_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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, 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_databases 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_databases ::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest.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_databases({ 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_databases(::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest.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_databases_client_stub.call_rpc_count + end + end + + def test_create_database + # Create GRPC objects. + grpc_response = ::Google::Cloud::AlloyDB::V1beta::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. + parent = "hello world" + database_id = "hello world" + database = {} + + create_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_database, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["database_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Database), request["database"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_database_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_database({ parent: parent, database_id: database_id, database: database }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_database parent: parent, database_id: database_id, database: database do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_database ::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new(parent: parent, database_id: database_id, database: database) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_database({ parent: parent, database_id: database_id, database: database }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_database(::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new(parent: parent, database_id: database_id, database: database), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_database_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_operations_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_operations_test.rb new file mode 100644 index 000000000000..4c9456854b1e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/alloydb/v1beta/csql_service_pb" +require "google/cloud/alloydb/v1beta/csql_service_services_pb" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" + +class ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_paths_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_paths_test.rb new file mode 100644 index 000000000000..e7b970af88a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_paths_test.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" + +class ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.backup_path project: "value0", location: "value1", backup: "value2" + assert_equal "projects/value0/locations/value1/backups/value2", path + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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_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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/global/networks/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_rest_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_rest_test.rb new file mode 100644 index 000000000000..12151996a935 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_rest_test.rb @@ -0,0 +1,156 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/alloydb/v1beta/csql_service_pb" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" + + +class ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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_restore_from_cloud_sql + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + cloudsql_backup_run_source = {} + parent = "hello world" + cluster_id = "hello world" + cluster = {} + + restore_from_cloud_sql_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::ServiceStub.stub :transcode_restore_from_cloud_sql_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_from_cloud_sql_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.restore_from_cloud_sql({ cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.restore_from_cloud_sql cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.restore_from_cloud_sql ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new(cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.restore_from_cloud_sql({ cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.restore_from_cloud_sql(::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new(cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_from_cloud_sql_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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_test.rb new file mode 100644 index 000000000000..26872d3f8985 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_test.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/alloydb/v1beta/csql_service_pb" +require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" + +class ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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_restore_from_cloud_sql + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + cloudsql_backup_run_source = {} + parent = "hello world" + cluster_id = "hello world" + cluster = {} + + restore_from_cloud_sql_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_from_cloud_sql, name + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource), request["cloudsql_backup_run_source"] + assert_equal :cloudsql_backup_run_source, request.source + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_from_cloud_sql_client_stub do + # Create client + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.restore_from_cloud_sql({ cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster }) do |response, 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_from_cloud_sql cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster do |response, 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_from_cloud_sql ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new(cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster) do |response, operation| + assert_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_from_cloud_sql({ cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster }, grpc_options) do |response, operation| + assert_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_from_cloud_sql(::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new(cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster), grpc_options) do |response, operation| + assert_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_from_cloud_sql_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/helper.rb new file mode 100644 index 000000000000..968201e8049d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 407914f02876252287313a929746a588a30bcbce Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 17 Dec 2025 21:09:59 +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 --- .../cloud/alloydb/v1beta/resources_pb.rb | 2 +- .../google/cloud/alloydb/v1beta/resources.rb | 3 + .../google-cloud-alloy_db-v1beta/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-alloy_db-v1beta/.rubocop.yml | 33 - .../google-cloud-alloy_db-v1beta/.toys.rb | 28 - .../google-cloud-alloy_db-v1beta/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-alloy_db-v1beta/CHANGELOG.md | 2 - .../google-cloud-alloy_db-v1beta/Gemfile | 11 - .../google-cloud-alloy_db-v1beta/LICENSE.md | 201 - .../google-cloud-alloy_db-v1beta/README.md | 154 - .../google-cloud-alloy_db-v1beta/Rakefile | 169 - .../gapic_metadata.json | 222 - .../google-cloud-alloy_db-v1beta.gemspec | 30 - .../lib/google-cloud-alloy_db-v1beta.rb | 21 - .../lib/google/cloud/alloy_db/v1beta.rb | 46 - .../cloud/alloy_db/v1beta/alloy_db_admin.rb | 56 - .../alloy_db/v1beta/alloy_db_admin/client.rb | 4929 ----------------- .../v1beta/alloy_db_admin/credentials.rb | 47 - .../v1beta/alloy_db_admin/operations.rb | 841 --- .../alloy_db/v1beta/alloy_db_admin/paths.rb | 231 - .../alloy_db/v1beta/alloy_db_admin/rest.rb | 54 - .../v1beta/alloy_db_admin/rest/client.rb | 4628 ---------------- .../v1beta/alloy_db_admin/rest/operations.rb | 924 --- .../alloy_db_admin/rest/service_stub.rb | 2422 -------- .../v1beta/alloy_db_cloud_sql_admin.rb | 56 - .../v1beta/alloy_db_cloud_sql_admin/client.rb | 536 -- .../alloy_db_cloud_sql_admin/credentials.rb | 47 - .../alloy_db_cloud_sql_admin/operations.rb | 841 --- .../v1beta/alloy_db_cloud_sql_admin/paths.rb | 149 - .../v1beta/alloy_db_cloud_sql_admin/rest.rb | 54 - .../alloy_db_cloud_sql_admin/rest/client.rb | 494 -- .../rest/operations.rb | 924 --- .../rest/service_stub.rb | 143 - .../alloy_db/v1beta/bindings_override.rb | 75 - .../lib/google/cloud/alloy_db/v1beta/rest.rb | 39 - .../google/cloud/alloy_db/v1beta/version.rb | 28 - .../cloud/alloydb/v1beta/csql_resources_pb.rb | 44 - .../cloud/alloydb/v1beta/csql_service_pb.rb | 53 - .../v1beta/csql_service_services_pb.rb | 45 - .../cloud/alloydb/v1beta/data_model_pb.rb | 45 - .../google/cloud/alloydb/v1beta/gemini_pb.rb | 47 - .../cloud/alloydb/v1beta/resources_pb.rb | 125 - .../google/cloud/alloydb/v1beta/service_pb.rb | 136 - .../alloydb/v1beta/service_services_pb.rb | 147 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/alloydb/v1beta/csql_resources.rb | 42 - .../cloud/alloydb/v1beta/csql_service.rb | 45 - .../google/cloud/alloydb/v1beta/data_model.rb | 75 - .../google/cloud/alloydb/v1beta/gemini.rb | 67 - .../google/cloud/alloydb/v1beta/resources.rb | 1801 ------ .../google/cloud/alloydb/v1beta/service.rb | 1871 ------- .../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 | 121 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/date.rb | 53 - .../proto_docs/google/type/dayofweek.rb | 49 - .../proto_docs/google/type/expr.rb | 75 - .../proto_docs/google/type/timeofday.rb | 45 - .../snippets/Gemfile | 32 - .../alloy_db_admin/batch_create_instances.rb | 54 - .../snippets/alloy_db_admin/create_backup.rb | 54 - .../snippets/alloy_db_admin/create_cluster.rb | 54 - .../alloy_db_admin/create_database.rb | 47 - .../alloy_db_admin/create_instance.rb | 54 - .../create_secondary_cluster.rb | 54 - .../create_secondary_instance.rb | 54 - .../snippets/alloy_db_admin/create_user.rb | 47 - .../snippets/alloy_db_admin/delete_backup.rb | 54 - .../snippets/alloy_db_admin/delete_cluster.rb | 54 - .../alloy_db_admin/delete_instance.rb | 54 - .../snippets/alloy_db_admin/delete_user.rb | 47 - .../snippets/alloy_db_admin/execute_sql.rb | 47 - .../snippets/alloy_db_admin/export_cluster.rb | 54 - .../alloy_db_admin/failover_instance.rb | 54 - .../generate_client_certificate.rb | 47 - .../snippets/alloy_db_admin/get_backup.rb | 47 - .../snippets/alloy_db_admin/get_cluster.rb | 47 - .../alloy_db_admin/get_connection_info.rb | 47 - .../snippets/alloy_db_admin/get_instance.rb | 47 - .../snippets/alloy_db_admin/get_user.rb | 47 - .../snippets/alloy_db_admin/import_cluster.rb | 54 - .../snippets/alloy_db_admin/inject_fault.rb | 54 - .../snippets/alloy_db_admin/list_backups.rb | 51 - .../snippets/alloy_db_admin/list_clusters.rb | 51 - .../snippets/alloy_db_admin/list_databases.rb | 51 - .../snippets/alloy_db_admin/list_instances.rb | 51 - .../list_supported_database_flags.rb | 51 - .../snippets/alloy_db_admin/list_users.rb | 51 - .../alloy_db_admin/promote_cluster.rb | 54 - .../alloy_db_admin/restart_instance.rb | 54 - .../alloy_db_admin/restore_cluster.rb | 54 - .../alloy_db_admin/switchover_cluster.rb | 54 - .../snippets/alloy_db_admin/update_backup.rb | 54 - .../snippets/alloy_db_admin/update_cluster.rb | 54 - .../alloy_db_admin/update_instance.rb | 54 - .../snippets/alloy_db_admin/update_user.rb | 47 - .../alloy_db_admin/upgrade_cluster.rb | 54 - .../restore_from_cloud_sql.rb | 54 - ..._metadata_google.cloud.alloydb.v1beta.json | 1575 ------ .../v1beta/alloy_db_admin_operations_test.rb | 400 -- .../v1beta/alloy_db_admin_paths_test.rb | 163 - .../v1beta/alloy_db_admin_rest_test.rb | 2271 -------- .../alloy_db/v1beta/alloy_db_admin_test.rb | 2702 --------- ...lloy_db_cloud_sql_admin_operations_test.rb | 400 -- .../alloy_db_cloud_sql_admin_paths_test.rb | 115 - .../alloy_db_cloud_sql_admin_rest_test.rb | 156 - .../v1beta/alloy_db_cloud_sql_admin_test.rb | 188 - .../test/helper.rb | 25 - 120 files changed, 4 insertions(+), 35354 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.gitignore delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/.yardopts delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/Gemfile delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/README.md delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/Rakefile delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/google-cloud-alloy_db-v1beta.gemspec delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google-cloud-alloy_db-v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/rest.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/version.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/data_model_pb.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/gemini_pb.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_service.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/data_model.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/gemini.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/service.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/date.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/dayofweek.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/timeofday.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/batch_create_instances.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_backup.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_database.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_instance.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_instance.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_user.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_backup.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_instance.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_user.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/execute_sql.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/export_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/failover_instance.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/generate_client_certificate.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_backup.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_connection_info.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_instance.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_user.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/import_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/inject_fault.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_backups.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_databases.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_instances.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_supported_database_flags.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_users.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/promote_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restart_instance.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restore_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/switchover_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_backup.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_instance.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_user.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/upgrade_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/snippet_metadata_google.cloud.alloydb.v1beta.json delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_test.rb delete mode 100644 owl-bot-staging/google-cloud-alloy_db-v1beta/test/helper.rb diff --git a/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb b/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb index b672446070d9..7203024f9417 100644 --- a/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb +++ b/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb @@ -17,7 +17,7 @@ require 'google/type/timeofday_pb' -descriptor_data = "\n+google/cloud/alloydb/v1beta/resources.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/alloydb/v1beta/csql_resources.proto\x1a(google/cloud/alloydb/v1beta/gemini.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x16google/type/date.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\".\n\x0cUserPassword\x12\x0c\n\x04user\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\xe7\x01\n\x0fMigrationSource\x12\x16\n\thost_port\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0creference_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x0bsource_type\x18\x03 \x01(\x0e\x32@.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceTypeB\x03\xe0\x41\x03\"E\n\x13MigrationSourceType\x12%\n!MIGRATION_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x44MS\x10\x01\"P\n\x10\x45ncryptionConfig\x12<\n\x0ckms_key_name\x18\x01 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x8a\x02\n\x0e\x45ncryptionInfo\x12N\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\\\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\"\x86\x03\n\tSslConfig\x12\x45\n\x08ssl_mode\x18\x01 \x01(\x0e\x32..google.cloud.alloydb.v1beta.SslConfig.SslModeB\x03\xe0\x41\x01\x12G\n\tca_source\x18\x02 \x01(\x0e\x32/.google.cloud.alloydb.v1beta.SslConfig.CaSourceB\x03\xe0\x41\x01\"\xaa\x01\n\x07SslMode\x12\x18\n\x14SSL_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x0eSSL_MODE_ALLOW\x10\x01\x1a\x02\x08\x01\x12\x18\n\x10SSL_MODE_REQUIRE\x10\x02\x1a\x02\x08\x01\x12\x1a\n\x12SSL_MODE_VERIFY_CA\x10\x03\x1a\x02\x08\x01\x12#\n\x1f\x41LLOW_UNENCRYPTED_AND_ENCRYPTED\x10\x04\x12\x12\n\x0e\x45NCRYPTED_ONLY\x10\x05\"<\n\x08\x43\x61Source\x12\x19\n\x15\x43\x41_SOURCE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43\x41_SOURCE_MANAGED\x10\x01\"\xf9\x06\n\x15\x41utomatedBackupPolicy\x12\\\n\x0fweekly_schedule\x18\x02 \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleH\x00\x12\x65\n\x14time_based_retention\x18\x04 \x01(\x0b\x32\x45.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionH\x01\x12m\n\x18quantity_based_retention\x18\x05 \x01(\x0b\x32I.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionH\x01\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x02\x88\x01\x01\x12\x30\n\rbackup_window\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12M\n\x11\x65ncryption_config\x18\x08 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12\x10\n\x08location\x18\x06 \x01(\t\x12N\n\x06labels\x18\x07 \x03(\x0b\x32>.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.LabelsEntry\x1ak\n\x0eWeeklySchedule\x12+\n\x0bstart_times\x18\x01 \x03(\x0b\x32\x16.google.type.TimeOfDay\x12,\n\x0c\x64\x61ys_of_week\x18\x02 \x03(\x0e\x32\x16.google.type.DayOfWeek\x1aI\n\x12TimeBasedRetention\x12\x33\n\x10retention_period\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\'\n\x16QuantityBasedRetention\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\n\n\x08scheduleB\x0b\n\tretentionB\n\n\x08_enabled\"\xa2\x01\n\x16\x43ontinuousBackupConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x14recovery_window_days\x18\x04 \x01(\x05\x12H\n\x11\x65ncryption_config\x18\x03 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\n\n\x08_enabled\"\x8a\x02\n\x14\x43ontinuousBackupInfo\x12I\n\x0f\x65ncryption_info\x18\x01 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12\x35\n\x0c\x65nabled_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12-\n\x08schedule\x18\x03 \x03(\x0e\x32\x16.google.type.DayOfWeekB\x03\xe0\x41\x03\x12\x41\n\x18\x65\x61rliest_restorable_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\x0c\x42\x61\x63kupSource\x12\x17\n\nbackup_uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12:\n\x0b\x62\x61\x63kup_name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61lloydb.googleapis.com/Backup\"f\n\x16\x43ontinuousBackupSource\x12\x14\n\x07\x63luster\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\rpoint_in_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"\xde\x03\n\x17MaintenanceUpdatePolicy\x12\x63\n\x13maintenance_windows\x18\x01 \x03(\x0b\x32\x46.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow\x12l\n\x18\x64\x65ny_maintenance_periods\x18\x02 \x03(\x0b\x32J.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod\x1a\x64\n\x11MaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\x1a\x89\x01\n\x15\x44\x65nyMaintenancePeriod\x12%\n\nstart_date\x18\x01 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12$\n\x04time\x18\x03 \x01(\x0b\x32\x16.google.type.TimeOfDay\"J\n\x13MaintenanceSchedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xf6\x1a\n\x07\x43luster\x12G\n\rbackup_source\x18\x0f \x01(\x0b\x32).google.cloud.alloydb.v1beta.BackupSourceB\x03\xe0\x41\x03H\x00\x12M\n\x10migration_source\x18\x10 \x01(\x0b\x32,.google.cloud.alloydb.v1beta.MigrationSourceB\x03\xe0\x41\x03H\x00\x12_\n\x1a\x63loudsql_backup_run_source\x18* \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.CloudSQLBackupRunSourceB\x03\xe0\x41\x03H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x06labels\x18\x07 \x03(\x0b\x32\x30.google.cloud.alloydb.v1beta.Cluster.LabelsEntry\x12>\n\x05state\x18\x08 \x01(\x0e\x32*.google.cloud.alloydb.v1beta.Cluster.StateB\x03\xe0\x41\x03\x12K\n\x0c\x63luster_type\x18\x18 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.Cluster.ClusterTypeB\x03\xe0\x41\x03\x12K\n\x10\x64\x61tabase_version\x18\t \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\x03\xe0\x41\x01\x12O\n\x0enetwork_config\x18\x1d \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.NetworkConfigB\x03\xe0\x41\x01\x12\x39\n\x07network\x18\n \x01(\tB(\x18\x01\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t\x12J\n\x0b\x61nnotations\x18\x0c \x03(\x0b\x32\x35.google.cloud.alloydb.v1beta.Cluster.AnnotationsEntry\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12\x44\n\x0cinitial_user\x18\x0e \x01(\x0b\x32).google.cloud.alloydb.v1beta.UserPasswordB\x03\xe0\x41\x04\x12S\n\x17\x61utomated_backup_policy\x18\x11 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.AutomatedBackupPolicy\x12>\n\nssl_config\x18\x12 \x01(\x0b\x32&.google.cloud.alloydb.v1beta.SslConfigB\x02\x18\x01\x12M\n\x11\x65ncryption_config\x18\x13 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12I\n\x0f\x65ncryption_info\x18\x14 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12Z\n\x18\x63ontinuous_backup_config\x18\x1b \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.ContinuousBackupConfigB\x03\xe0\x41\x01\x12V\n\x16\x63ontinuous_backup_info\x18\x1c \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.ContinuousBackupInfoB\x03\xe0\x41\x03\x12N\n\x10secondary_config\x18\x16 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig\x12O\n\x0eprimary_config\x18\x17 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x1e \x01(\x08\x42\x03\xe0\x41\x03\x12G\n\npsc_config\x18\x1f \x01(\x0b\x32..google.cloud.alloydb.v1beta.Cluster.PscConfigB\x03\xe0\x41\x01\x12\\\n\x19maintenance_update_policy\x18 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicyB\x03\xe0\x41\x01\x12S\n\x14maintenance_schedule\x18% \x01(\x0b\x32\x30.google.cloud.alloydb.v1beta.MaintenanceScheduleB\x03\xe0\x41\x03\x12N\n\rgemini_config\x18$ \x01(\x0b\x32\x30.google.cloud.alloydb.v1beta.GeminiClusterConfigB\x05\x18\x01\xe0\x41\x01\x12M\n\x11subscription_type\x18& \x01(\x0e\x32-.google.cloud.alloydb.v1beta.SubscriptionTypeB\x03\xe0\x41\x01\x12O\n\x0etrial_metadata\x18\' \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.TrialMetadataB\x03\xe0\x41\x03\x12G\n\x04tags\x18) \x03(\x0b\x32..google.cloud.alloydb.v1beta.Cluster.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x12\"\n\x15service_account_email\x18. \x01(\tB\x03\xe0\x41\x03\x1ai\n\rNetworkConfig\x12\x37\n\x07network\x18\x01 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x1f\n\x12\x61llocated_ip_range\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1aT\n\x0fSecondaryConfig\x12\x41\n\x14primary_cluster_name\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x1aX\n\rPrimaryConfig\x12G\n\x17secondary_cluster_names\x18\x01 \x03(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x1aP\n\tPscConfig\x12\x18\n\x0bpsc_enabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1cservice_owned_project_number\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x1a\xd3\x01\n\rTrialMetadata\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\x12\x30\n\x0cupgrade_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0egrace_end_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9c\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\t\n\x05\x45MPTY\x10\x03\x12\x0c\n\x08\x43REATING\x10\x04\x12\x0c\n\x08\x44\x45LETING\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x11\n\rBOOTSTRAPPING\x10\x07\x12\x0f\n\x0bMAINTENANCE\x10\x08\x12\r\n\tPROMOTING\x10\t\"G\n\x0b\x43lusterType\x12\x1c\n\x18\x43LUSTER_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02:u\xea\x41r\n\x1e\x61lloydb.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterR\x01\x01\x42\x08\n\x06source\"\xa2)\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x07 \x03(\x0b\x32\x31.google.cloud.alloydb.v1beta.Instance.LabelsEntry\x12?\n\x05state\x18\x08 \x01(\x0e\x32+.google.cloud.alloydb.v1beta.Instance.StateB\x03\xe0\x41\x03\x12N\n\rinstance_type\x18\t \x01(\x0e\x32\x32.google.cloud.alloydb.v1beta.Instance.InstanceTypeB\x03\xe0\x41\x02\x12K\n\x0emachine_config\x18\n \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.Instance.MachineConfig\x12Q\n\x11\x61vailability_type\x18\x0b \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.Instance.AvailabilityType\x12\x10\n\x08gce_zone\x18\x0c \x01(\t\x12P\n\x0e\x64\x61tabase_flags\x18\r \x03(\x0b\x32\x38.google.cloud.alloydb.v1beta.Instance.DatabaseFlagsEntry\x12\x46\n\rwritable_node\x18\x13 \x01(\x0b\x32*.google.cloud.alloydb.v1beta.Instance.NodeB\x03\xe0\x41\x03\x12>\n\x05nodes\x18\x14 \x03(\x0b\x32*.google.cloud.alloydb.v1beta.Instance.NodeB\x03\xe0\x41\x03\x12`\n\x15query_insights_config\x18\x15 \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig\x12_\n\x14observability_config\x18\x1a \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig\x12N\n\x10read_pool_config\x18\x0e \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig\x12\x17\n\nip_address\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12&\n\x11public_ip_address\x18\x1b \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x18\n\x0breconciling\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x11 \x01(\t\x12K\n\x0b\x61nnotations\x18\x12 \x03(\x0b\x32\x36.google.cloud.alloydb.v1beta.Instance.AnnotationsEntry\x12I\n\rupdate_policy\x18\x16 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Instance.UpdatePolicy\x12\x63\n\x18\x63lient_connection_config\x18\x17 \x01(\x0b\x32<.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfigB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03\x12Y\n\x13psc_instance_config\x18\x1c \x01(\x0b\x32\x37.google.cloud.alloydb.v1beta.Instance.PscInstanceConfigB\x03\xe0\x41\x01\x12X\n\x0enetwork_config\x18\x1d \x01(\x0b\x32;.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfigB\x03\xe0\x41\x01\x12O\n\rgemini_config\x18! \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.GeminiInstanceConfigB\x05\x18\x01\xe0\x41\x01\x12\x31\n\x1coutbound_public_ip_addresses\x18\" \x03(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12V\n\x11\x61\x63tivation_policy\x18# \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.Instance.ActivationPolicyB\x03\xe0\x41\x01\x12_\n\x16\x63onnection_pool_config\x18% \x01(\x0b\x32:.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfigB\x03\xe0\x41\x01\x12G\n\ngca_config\x18& \x01(\x0b\x32..google.cloud.alloydb.v1beta.GCAInstanceConfigB\x03\xe0\x41\x03\x1a\x38\n\rMachineConfig\x12\x11\n\tcpu_count\x18\x01 \x01(\x05\x12\x14\n\x0cmachine_type\x18\x04 \x01(\t\x1aR\n\x04Node\x12\x14\n\x07zone_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02ip\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05state\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a\xfa\x01\n\x1bQueryInsightsInstanceConfig\x12$\n\x17record_application_tags\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\"\n\x15record_client_address\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x1b\n\x13query_string_length\x18\x04 \x01(\r\x12#\n\x16query_plans_per_minute\x18\x05 \x01(\rH\x02\x88\x01\x01\x42\x1a\n\x18_record_application_tagsB\x18\n\x16_record_client_addressB\x19\n\x17_query_plans_per_minute\x1a\xfa\x04\n\x1bObservabilityInstanceConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1e\n\x11preserve_comments\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x1e\n\x11track_wait_events\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12(\n\x16track_wait_event_types\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12$\n\x17max_query_string_length\x18\x05 \x01(\x05H\x04\x88\x01\x01\x12$\n\x17record_application_tags\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12#\n\x16query_plans_per_minute\x18\x07 \x01(\x05H\x06\x88\x01\x01\x12!\n\x14track_active_queries\x18\x08 \x01(\x08H\x07\x88\x01\x01\x12!\n\x14track_client_address\x18\t \x01(\x08H\x08\x88\x01\x01\x12*\n\x1d\x61ssistive_experiences_enabled\x18\n \x01(\x08H\t\x88\x01\x01\x42\n\n\x08_enabledB\x14\n\x12_preserve_commentsB\x14\n\x12_track_wait_eventsB\x19\n\x17_track_wait_event_typesB\x1a\n\x18_max_query_string_lengthB\x1a\n\x18_record_application_tagsB\x19\n\x17_query_plans_per_minuteB\x17\n\x15_track_active_queriesB\x17\n\x15_track_client_addressB \n\x1e_assistive_experiences_enabled\x1a$\n\x0eReadPoolConfig\x12\x12\n\nnode_count\x18\x01 \x01(\x05\x1a\x91\x01\n\x0cUpdatePolicy\x12\x45\n\x04mode\x18\x01 \x01(\x0e\x32\x37.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode\":\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x0f\n\x0b\x46ORCE_APPLY\x10\x02\x1az\n\x16\x43lientConnectionConfig\x12\x1f\n\x12require_connectors\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12?\n\nssl_config\x18\x02 \x01(\x0b\x32&.google.cloud.alloydb.v1beta.SslConfigB\x03\xe0\x41\x01\x1a\x39\n\x12PscInterfaceConfig\x12#\n\x1bnetwork_attachment_resource\x18\x01 \x01(\t\x1a\xa9\x01\n\x17PscAutoConnectionConfig\x12\x18\n\x10\x63onsumer_project\x18\x01 \x01(\t\x12\x18\n\x10\x63onsumer_network\x18\x02 \x01(\t\x12\x1f\n\nip_address\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x13\n\x06status\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12$\n\x17\x63onsumer_network_status\x18\x05 \x01(\tB\x03\xe0\x41\x03\x1a\xe9\x02\n\x11PscInstanceConfig\x12Q\n\x17service_attachment_link\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12&\n\x19\x61llowed_consumer_projects\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cpsc_dns_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\\\n\x15psc_interface_configs\x18\x08 \x03(\x0b\x32\x38.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfigB\x03\xe0\x41\x01\x12`\n\x14psc_auto_connections\x18\t \x03(\x0b\x32=.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfigB\x03\xe0\x41\x01\x1a\xee\x02\n\x15InstanceNetworkConfig\x12x\n\x1c\x61uthorized_external_networks\x18\x01 \x03(\x0b\x32M.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetworkB\x03\xe0\x41\x01\x12\x1d\n\x10\x65nable_public_ip\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12&\n\x19\x65nable_outbound_public_ip\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x04 \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12(\n\x1b\x61llocated_ip_range_override\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x31\n\x11\x41uthorizedNetwork\x12\x1c\n\ncidr_range\x18\x01 \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x1a\xd0\x01\n\x14\x43onnectionPoolConfig\x12\x14\n\x07\x65nabled\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12Y\n\x05\x66lags\x18\r \x03(\x0b\x32\x45.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.FlagsEntryB\x03\xe0\x41\x01\x12\x19\n\x0cpooler_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x1a,\n\nFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12\x44\x61tabaseFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x91\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0f\n\x0bMAINTENANCE\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x11\n\rBOOTSTRAPPING\x10\x08\x12\r\n\tPROMOTING\x10\t\"X\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tREAD_POOL\x10\x02\x12\r\n\tSECONDARY\x10\x03\"N\n\x10\x41vailabilityType\x12!\n\x1d\x41VAILABILITY_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05ZONAL\x10\x01\x12\x0c\n\x08REGIONAL\x10\x02\"L\n\x10\x41\x63tivationPolicy\x12!\n\x1d\x41\x43TIVATION_POLICY_UNSPECIFIED\x10\x00\x12\n\n\x06\x41LWAYS\x10\x01\x12\t\n\x05NEVER\x10\x02:\x8e\x01\xea\x41\x8a\x01\n\x1f\x61lloydb.googleapis.com/Instance\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}*\tinstances2\x08instanceR\x01\x01\"\xea\x02\n\x0e\x43onnectionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\nip_address\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12&\n\x11public_ip_address\x18\x05 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12$\n\x15pem_certificate_chain\x18\x03 \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x19\n\x0cinstance_uid\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cpsc_dns_name\x18\x06 \x01(\tB\x03\xe0\x41\x03:\xac\x01\xea\x41\xa8\x01\n%alloydb.googleapis.com/ConnectionInfo\x12^projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo*\x0f\x63onnectionInfos2\x0e\x63onnectionInfo\"\xa9\r\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x16\x63reate_completion_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x06 \x03(\x0b\x32/.google.cloud.alloydb.v1beta.Backup.LabelsEntry\x12=\n\x05state\x18\x07 \x01(\x0e\x32).google.cloud.alloydb.v1beta.Backup.StateB\x03\xe0\x41\x03\x12\x36\n\x04type\x18\x08 \x01(\x0e\x32(.google.cloud.alloydb.v1beta.Backup.Type\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12\x18\n\x0b\x63luster_uid\x18\x12 \x01(\tB\x03\xe0\x41\x03\x12<\n\x0c\x63luster_name\x18\n \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x18\n\x0breconciling\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03\x12M\n\x11\x65ncryption_config\x18\x0c \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12I\n\x0f\x65ncryption_info\x18\r \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0e \x01(\t\x12I\n\x0b\x61nnotations\x18\x10 \x03(\x0b\x32\x34.google.cloud.alloydb.v1beta.Backup.AnnotationsEntry\x12\x17\n\nsize_bytes\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpiry_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x0f\x65xpiry_quantity\x18\x14 \x01(\x0b\x32\x37.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiryB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x15 \x01(\x08\x42\x03\xe0\x41\x03\x12K\n\x10\x64\x61tabase_version\x18\x16 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\x03\xe0\x41\x03\x12\x46\n\x04tags\x18\x19 \x03(\x0b\x32-.google.cloud.alloydb.v1beta.Backup.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1aW\n\x13QuantityBasedExpiry\x12\x1c\n\x0fretention_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\"\n\x15total_retention_count\x18\x02 \x01(\x05\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\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"J\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\x12\x0e\n\nCONTINUOUS\x10\x03:p\xea\x41m\n\x1d\x61lloydb.googleapis.com/Backup\x12\x38projects/{project}/locations/{location}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kupR\x01\x01\"\x90\t\n\x15SupportedDatabaseFlag\x12\x64\n\x13string_restrictions\x18\x07 \x01(\x0b\x32\x45.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsH\x00\x12\x66\n\x14integer_restrictions\x18\x08 \x01(\x0b\x32\x46.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsH\x00\x12\"\n\x18recommended_string_value\x18\n \x01(\tH\x01\x12@\n\x19recommended_integer_value\x18\x0b \x01(\x0b\x32\x1b.google.protobuf.Int64ValueH\x01\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tflag_name\x18\x02 \x01(\t\x12P\n\nvalue_type\x18\x03 \x01(\x0e\x32<.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType\x12\x1f\n\x17\x61\x63\x63\x65pts_multiple_values\x18\x04 \x01(\x08\x12K\n\x15supported_db_versions\x18\x05 \x03(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12\x1b\n\x13requires_db_restart\x18\x06 \x01(\x08\x12G\n\x05scope\x18\t \x01(\x0e\x32\x38.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope\x1a,\n\x12StringRestrictions\x12\x16\n\x0e\x61llowed_values\x18\x01 \x03(\t\x1au\n\x13IntegerRestrictions\x12.\n\tmin_value\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12.\n\tmax_value\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"U\n\tValueType\x12\x1a\n\x16VALUE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\x0b\n\x07INTEGER\x10\x02\x12\t\n\x05\x46LOAT\x10\x03\x12\x08\n\x04NONE\x10\x04\"A\n\x05Scope\x12\x15\n\x11SCOPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44\x41TABASE\x10\x01\x12\x13\n\x0f\x43ONNECTION_POOL\x10\x02:\x97\x01\xea\x41\x93\x01\n,alloydb.googleapis.com/SupportedDatabaseFlag\x12\x34projects/{project}/locations/{location}/flags/{flag}*\x16supportedDatabaseFlags2\x15supportedDatabaseFlagB\x0e\n\x0crestrictionsB\x13\n\x11recommended_value\"\xfe\x02\n\x04User\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08password\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x1b\n\x0e\x64\x61tabase_roles\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x42\n\tuser_type\x18\x05 \x01(\x0e\x32*.google.cloud.alloydb.v1beta.User.UserTypeB\x03\xe0\x41\x01\x12\x1d\n\x10keep_extra_roles\x18\x06 \x01(\x08\x42\x03\xe0\x41\x04\"Q\n\x08UserType\x12\x19\n\x15USER_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41LLOYDB_BUILT_IN\x10\x01\x12\x14\n\x10\x41LLOYDB_IAM_USER\x10\x02:y\xea\x41v\n\x1b\x61lloydb.googleapis.com/User\x12Gprojects/{project}/locations/{location}/clusters/{cluster}/users/{user}*\x05users2\x04userR\x01\x01\"\x82\x03\n\x08\x44\x61tabase\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x17\n\x07\x63harset\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x19\n\tcollation\x18\x03 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1e\n\x0e\x63haracter_type\x18\x04 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1a\n\x0bis_template\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12!\n\x11\x64\x61tabase_template\x18\x06 \x01(\tB\x06\xe0\x41\x04\xe0\x41\x05\x12&\n\x14is_template_database\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01:\x8e\x01\xea\x41\x8a\x01\n\x1f\x61lloydb.googleapis.com/Database\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/databases/{database}*\tdatabases2\x08\x64\x61tabaseR\x01\x01\x42\x17\n\x15_is_template_database*^\n\x0cInstanceView\x12\x1d\n\x19INSTANCE_VIEW_UNSPECIFIED\x10\x00\x12\x17\n\x13INSTANCE_VIEW_BASIC\x10\x01\x12\x16\n\x12INSTANCE_VIEW_FULL\x10\x02*g\n\x0b\x43lusterView\x12\x1c\n\x18\x43LUSTER_VIEW_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43LUSTER_VIEW_BASIC\x10\x01\x12\"\n\x1e\x43LUSTER_VIEW_CONTINUOUS_BACKUP\x10\x02*\x8c\x01\n\x0f\x44\x61tabaseVersion\x12 \n\x1c\x44\x41TABASE_VERSION_UNSPECIFIED\x10\x00\x12\x13\n\x0bPOSTGRES_13\x10\x01\x1a\x02\x08\x01\x12\x0f\n\x0bPOSTGRES_14\x10\x02\x12\x0f\n\x0bPOSTGRES_15\x10\x03\x12\x0f\n\x0bPOSTGRES_16\x10\x04\x12\x0f\n\x0bPOSTGRES_17\x10\x05*N\n\x10SubscriptionType\x12!\n\x1dSUBSCRIPTION_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\t\n\x05TRIAL\x10\x02\x42\xbb\x05\n\x1f\x63om.google.cloud.alloydb.v1betaB\x0eResourcesProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1beta\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}b\x06proto3" +descriptor_data = "\n+google/cloud/alloydb/v1beta/resources.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/alloydb/v1beta/csql_resources.proto\x1a(google/cloud/alloydb/v1beta/gemini.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x16google/type/date.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\".\n\x0cUserPassword\x12\x0c\n\x04user\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\xe7\x01\n\x0fMigrationSource\x12\x16\n\thost_port\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0creference_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x0bsource_type\x18\x03 \x01(\x0e\x32@.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceTypeB\x03\xe0\x41\x03\"E\n\x13MigrationSourceType\x12%\n!MIGRATION_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x44MS\x10\x01\"P\n\x10\x45ncryptionConfig\x12<\n\x0ckms_key_name\x18\x01 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x8a\x02\n\x0e\x45ncryptionInfo\x12N\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\\\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\"\x86\x03\n\tSslConfig\x12\x45\n\x08ssl_mode\x18\x01 \x01(\x0e\x32..google.cloud.alloydb.v1beta.SslConfig.SslModeB\x03\xe0\x41\x01\x12G\n\tca_source\x18\x02 \x01(\x0e\x32/.google.cloud.alloydb.v1beta.SslConfig.CaSourceB\x03\xe0\x41\x01\"\xaa\x01\n\x07SslMode\x12\x18\n\x14SSL_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x0eSSL_MODE_ALLOW\x10\x01\x1a\x02\x08\x01\x12\x18\n\x10SSL_MODE_REQUIRE\x10\x02\x1a\x02\x08\x01\x12\x1a\n\x12SSL_MODE_VERIFY_CA\x10\x03\x1a\x02\x08\x01\x12#\n\x1f\x41LLOW_UNENCRYPTED_AND_ENCRYPTED\x10\x04\x12\x12\n\x0e\x45NCRYPTED_ONLY\x10\x05\"<\n\x08\x43\x61Source\x12\x19\n\x15\x43\x41_SOURCE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43\x41_SOURCE_MANAGED\x10\x01\"\xf9\x06\n\x15\x41utomatedBackupPolicy\x12\\\n\x0fweekly_schedule\x18\x02 \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleH\x00\x12\x65\n\x14time_based_retention\x18\x04 \x01(\x0b\x32\x45.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionH\x01\x12m\n\x18quantity_based_retention\x18\x05 \x01(\x0b\x32I.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionH\x01\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x02\x88\x01\x01\x12\x30\n\rbackup_window\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12M\n\x11\x65ncryption_config\x18\x08 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12\x10\n\x08location\x18\x06 \x01(\t\x12N\n\x06labels\x18\x07 \x03(\x0b\x32>.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.LabelsEntry\x1ak\n\x0eWeeklySchedule\x12+\n\x0bstart_times\x18\x01 \x03(\x0b\x32\x16.google.type.TimeOfDay\x12,\n\x0c\x64\x61ys_of_week\x18\x02 \x03(\x0e\x32\x16.google.type.DayOfWeek\x1aI\n\x12TimeBasedRetention\x12\x33\n\x10retention_period\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\'\n\x16QuantityBasedRetention\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\n\n\x08scheduleB\x0b\n\tretentionB\n\n\x08_enabled\"\xa2\x01\n\x16\x43ontinuousBackupConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x14recovery_window_days\x18\x04 \x01(\x05\x12H\n\x11\x65ncryption_config\x18\x03 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\n\n\x08_enabled\"\x8a\x02\n\x14\x43ontinuousBackupInfo\x12I\n\x0f\x65ncryption_info\x18\x01 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12\x35\n\x0c\x65nabled_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12-\n\x08schedule\x18\x03 \x03(\x0e\x32\x16.google.type.DayOfWeekB\x03\xe0\x41\x03\x12\x41\n\x18\x65\x61rliest_restorable_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\x0c\x42\x61\x63kupSource\x12\x17\n\nbackup_uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12:\n\x0b\x62\x61\x63kup_name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61lloydb.googleapis.com/Backup\"f\n\x16\x43ontinuousBackupSource\x12\x14\n\x07\x63luster\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\rpoint_in_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"\xde\x03\n\x17MaintenanceUpdatePolicy\x12\x63\n\x13maintenance_windows\x18\x01 \x03(\x0b\x32\x46.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow\x12l\n\x18\x64\x65ny_maintenance_periods\x18\x02 \x03(\x0b\x32J.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod\x1a\x64\n\x11MaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\x1a\x89\x01\n\x15\x44\x65nyMaintenancePeriod\x12%\n\nstart_date\x18\x01 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12$\n\x04time\x18\x03 \x01(\x0b\x32\x16.google.type.TimeOfDay\"J\n\x13MaintenanceSchedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xf6\x1a\n\x07\x43luster\x12G\n\rbackup_source\x18\x0f \x01(\x0b\x32).google.cloud.alloydb.v1beta.BackupSourceB\x03\xe0\x41\x03H\x00\x12M\n\x10migration_source\x18\x10 \x01(\x0b\x32,.google.cloud.alloydb.v1beta.MigrationSourceB\x03\xe0\x41\x03H\x00\x12_\n\x1a\x63loudsql_backup_run_source\x18* \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.CloudSQLBackupRunSourceB\x03\xe0\x41\x03H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x06labels\x18\x07 \x03(\x0b\x32\x30.google.cloud.alloydb.v1beta.Cluster.LabelsEntry\x12>\n\x05state\x18\x08 \x01(\x0e\x32*.google.cloud.alloydb.v1beta.Cluster.StateB\x03\xe0\x41\x03\x12K\n\x0c\x63luster_type\x18\x18 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.Cluster.ClusterTypeB\x03\xe0\x41\x03\x12K\n\x10\x64\x61tabase_version\x18\t \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\x03\xe0\x41\x01\x12O\n\x0enetwork_config\x18\x1d \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.NetworkConfigB\x03\xe0\x41\x01\x12\x39\n\x07network\x18\n \x01(\tB(\x18\x01\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t\x12J\n\x0b\x61nnotations\x18\x0c \x03(\x0b\x32\x35.google.cloud.alloydb.v1beta.Cluster.AnnotationsEntry\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12\x44\n\x0cinitial_user\x18\x0e \x01(\x0b\x32).google.cloud.alloydb.v1beta.UserPasswordB\x03\xe0\x41\x04\x12S\n\x17\x61utomated_backup_policy\x18\x11 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.AutomatedBackupPolicy\x12>\n\nssl_config\x18\x12 \x01(\x0b\x32&.google.cloud.alloydb.v1beta.SslConfigB\x02\x18\x01\x12M\n\x11\x65ncryption_config\x18\x13 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12I\n\x0f\x65ncryption_info\x18\x14 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12Z\n\x18\x63ontinuous_backup_config\x18\x1b \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.ContinuousBackupConfigB\x03\xe0\x41\x01\x12V\n\x16\x63ontinuous_backup_info\x18\x1c \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.ContinuousBackupInfoB\x03\xe0\x41\x03\x12N\n\x10secondary_config\x18\x16 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig\x12O\n\x0eprimary_config\x18\x17 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x1e \x01(\x08\x42\x03\xe0\x41\x03\x12G\n\npsc_config\x18\x1f \x01(\x0b\x32..google.cloud.alloydb.v1beta.Cluster.PscConfigB\x03\xe0\x41\x01\x12\\\n\x19maintenance_update_policy\x18 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicyB\x03\xe0\x41\x01\x12S\n\x14maintenance_schedule\x18% \x01(\x0b\x32\x30.google.cloud.alloydb.v1beta.MaintenanceScheduleB\x03\xe0\x41\x03\x12N\n\rgemini_config\x18$ \x01(\x0b\x32\x30.google.cloud.alloydb.v1beta.GeminiClusterConfigB\x05\x18\x01\xe0\x41\x01\x12M\n\x11subscription_type\x18& \x01(\x0e\x32-.google.cloud.alloydb.v1beta.SubscriptionTypeB\x03\xe0\x41\x01\x12O\n\x0etrial_metadata\x18\' \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.TrialMetadataB\x03\xe0\x41\x03\x12G\n\x04tags\x18) \x03(\x0b\x32..google.cloud.alloydb.v1beta.Cluster.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x12\"\n\x15service_account_email\x18. \x01(\tB\x03\xe0\x41\x03\x1ai\n\rNetworkConfig\x12\x37\n\x07network\x18\x01 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x1f\n\x12\x61llocated_ip_range\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1aT\n\x0fSecondaryConfig\x12\x41\n\x14primary_cluster_name\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x1aX\n\rPrimaryConfig\x12G\n\x17secondary_cluster_names\x18\x01 \x03(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x1aP\n\tPscConfig\x12\x18\n\x0bpsc_enabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1cservice_owned_project_number\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x1a\xd3\x01\n\rTrialMetadata\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\x12\x30\n\x0cupgrade_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0egrace_end_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9c\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\t\n\x05\x45MPTY\x10\x03\x12\x0c\n\x08\x43REATING\x10\x04\x12\x0c\n\x08\x44\x45LETING\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x11\n\rBOOTSTRAPPING\x10\x07\x12\x0f\n\x0bMAINTENANCE\x10\x08\x12\r\n\tPROMOTING\x10\t\"G\n\x0b\x43lusterType\x12\x1c\n\x18\x43LUSTER_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02:u\xea\x41r\n\x1e\x61lloydb.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterR\x01\x01\x42\x08\n\x06source\"\xa2)\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x07 \x03(\x0b\x32\x31.google.cloud.alloydb.v1beta.Instance.LabelsEntry\x12?\n\x05state\x18\x08 \x01(\x0e\x32+.google.cloud.alloydb.v1beta.Instance.StateB\x03\xe0\x41\x03\x12N\n\rinstance_type\x18\t \x01(\x0e\x32\x32.google.cloud.alloydb.v1beta.Instance.InstanceTypeB\x03\xe0\x41\x02\x12K\n\x0emachine_config\x18\n \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.Instance.MachineConfig\x12Q\n\x11\x61vailability_type\x18\x0b \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.Instance.AvailabilityType\x12\x10\n\x08gce_zone\x18\x0c \x01(\t\x12P\n\x0e\x64\x61tabase_flags\x18\r \x03(\x0b\x32\x38.google.cloud.alloydb.v1beta.Instance.DatabaseFlagsEntry\x12\x46\n\rwritable_node\x18\x13 \x01(\x0b\x32*.google.cloud.alloydb.v1beta.Instance.NodeB\x03\xe0\x41\x03\x12>\n\x05nodes\x18\x14 \x03(\x0b\x32*.google.cloud.alloydb.v1beta.Instance.NodeB\x03\xe0\x41\x03\x12`\n\x15query_insights_config\x18\x15 \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig\x12_\n\x14observability_config\x18\x1a \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig\x12N\n\x10read_pool_config\x18\x0e \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig\x12\x17\n\nip_address\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12&\n\x11public_ip_address\x18\x1b \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x18\n\x0breconciling\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x11 \x01(\t\x12K\n\x0b\x61nnotations\x18\x12 \x03(\x0b\x32\x36.google.cloud.alloydb.v1beta.Instance.AnnotationsEntry\x12I\n\rupdate_policy\x18\x16 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Instance.UpdatePolicy\x12\x63\n\x18\x63lient_connection_config\x18\x17 \x01(\x0b\x32<.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfigB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03\x12Y\n\x13psc_instance_config\x18\x1c \x01(\x0b\x32\x37.google.cloud.alloydb.v1beta.Instance.PscInstanceConfigB\x03\xe0\x41\x01\x12X\n\x0enetwork_config\x18\x1d \x01(\x0b\x32;.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfigB\x03\xe0\x41\x01\x12O\n\rgemini_config\x18! \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.GeminiInstanceConfigB\x05\x18\x01\xe0\x41\x01\x12\x31\n\x1coutbound_public_ip_addresses\x18\" \x03(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12V\n\x11\x61\x63tivation_policy\x18# \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.Instance.ActivationPolicyB\x03\xe0\x41\x01\x12_\n\x16\x63onnection_pool_config\x18% \x01(\x0b\x32:.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfigB\x03\xe0\x41\x01\x12G\n\ngca_config\x18& \x01(\x0b\x32..google.cloud.alloydb.v1beta.GCAInstanceConfigB\x03\xe0\x41\x03\x1a\x38\n\rMachineConfig\x12\x11\n\tcpu_count\x18\x01 \x01(\x05\x12\x14\n\x0cmachine_type\x18\x04 \x01(\t\x1aR\n\x04Node\x12\x14\n\x07zone_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02ip\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05state\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a\xfa\x01\n\x1bQueryInsightsInstanceConfig\x12$\n\x17record_application_tags\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\"\n\x15record_client_address\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x1b\n\x13query_string_length\x18\x04 \x01(\r\x12#\n\x16query_plans_per_minute\x18\x05 \x01(\rH\x02\x88\x01\x01\x42\x1a\n\x18_record_application_tagsB\x18\n\x16_record_client_addressB\x19\n\x17_query_plans_per_minute\x1a\xfa\x04\n\x1bObservabilityInstanceConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1e\n\x11preserve_comments\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x1e\n\x11track_wait_events\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12(\n\x16track_wait_event_types\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12$\n\x17max_query_string_length\x18\x05 \x01(\x05H\x04\x88\x01\x01\x12$\n\x17record_application_tags\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12#\n\x16query_plans_per_minute\x18\x07 \x01(\x05H\x06\x88\x01\x01\x12!\n\x14track_active_queries\x18\x08 \x01(\x08H\x07\x88\x01\x01\x12!\n\x14track_client_address\x18\t \x01(\x08H\x08\x88\x01\x01\x12*\n\x1d\x61ssistive_experiences_enabled\x18\n \x01(\x08H\t\x88\x01\x01\x42\n\n\x08_enabledB\x14\n\x12_preserve_commentsB\x14\n\x12_track_wait_eventsB\x19\n\x17_track_wait_event_typesB\x1a\n\x18_max_query_string_lengthB\x1a\n\x18_record_application_tagsB\x19\n\x17_query_plans_per_minuteB\x17\n\x15_track_active_queriesB\x17\n\x15_track_client_addressB \n\x1e_assistive_experiences_enabled\x1a$\n\x0eReadPoolConfig\x12\x12\n\nnode_count\x18\x01 \x01(\x05\x1a\x91\x01\n\x0cUpdatePolicy\x12\x45\n\x04mode\x18\x01 \x01(\x0e\x32\x37.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode\":\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x0f\n\x0b\x46ORCE_APPLY\x10\x02\x1az\n\x16\x43lientConnectionConfig\x12\x1f\n\x12require_connectors\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12?\n\nssl_config\x18\x02 \x01(\x0b\x32&.google.cloud.alloydb.v1beta.SslConfigB\x03\xe0\x41\x01\x1a\x39\n\x12PscInterfaceConfig\x12#\n\x1bnetwork_attachment_resource\x18\x01 \x01(\t\x1a\xa9\x01\n\x17PscAutoConnectionConfig\x12\x18\n\x10\x63onsumer_project\x18\x01 \x01(\t\x12\x18\n\x10\x63onsumer_network\x18\x02 \x01(\t\x12\x1f\n\nip_address\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x13\n\x06status\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12$\n\x17\x63onsumer_network_status\x18\x05 \x01(\tB\x03\xe0\x41\x03\x1a\xe9\x02\n\x11PscInstanceConfig\x12Q\n\x17service_attachment_link\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12&\n\x19\x61llowed_consumer_projects\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cpsc_dns_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\\\n\x15psc_interface_configs\x18\x08 \x03(\x0b\x32\x38.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfigB\x03\xe0\x41\x01\x12`\n\x14psc_auto_connections\x18\t \x03(\x0b\x32=.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfigB\x03\xe0\x41\x01\x1a\xee\x02\n\x15InstanceNetworkConfig\x12x\n\x1c\x61uthorized_external_networks\x18\x01 \x03(\x0b\x32M.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetworkB\x03\xe0\x41\x01\x12\x1d\n\x10\x65nable_public_ip\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12&\n\x19\x65nable_outbound_public_ip\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x04 \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12(\n\x1b\x61llocated_ip_range_override\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x31\n\x11\x41uthorizedNetwork\x12\x1c\n\ncidr_range\x18\x01 \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x1a\xd0\x01\n\x14\x43onnectionPoolConfig\x12\x14\n\x07\x65nabled\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12Y\n\x05\x66lags\x18\r \x03(\x0b\x32\x45.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.FlagsEntryB\x03\xe0\x41\x01\x12\x19\n\x0cpooler_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x1a,\n\nFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12\x44\x61tabaseFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x91\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0f\n\x0bMAINTENANCE\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x11\n\rBOOTSTRAPPING\x10\x08\x12\r\n\tPROMOTING\x10\t\"X\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tREAD_POOL\x10\x02\x12\r\n\tSECONDARY\x10\x03\"N\n\x10\x41vailabilityType\x12!\n\x1d\x41VAILABILITY_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05ZONAL\x10\x01\x12\x0c\n\x08REGIONAL\x10\x02\"L\n\x10\x41\x63tivationPolicy\x12!\n\x1d\x41\x43TIVATION_POLICY_UNSPECIFIED\x10\x00\x12\n\n\x06\x41LWAYS\x10\x01\x12\t\n\x05NEVER\x10\x02:\x8e\x01\xea\x41\x8a\x01\n\x1f\x61lloydb.googleapis.com/Instance\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}*\tinstances2\x08instanceR\x01\x01\"\xea\x02\n\x0e\x43onnectionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\nip_address\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12&\n\x11public_ip_address\x18\x05 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12$\n\x15pem_certificate_chain\x18\x03 \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x19\n\x0cinstance_uid\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cpsc_dns_name\x18\x06 \x01(\tB\x03\xe0\x41\x03:\xac\x01\xea\x41\xa8\x01\n%alloydb.googleapis.com/ConnectionInfo\x12^projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo*\x0f\x63onnectionInfos2\x0e\x63onnectionInfo\"\xa9\r\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x16\x63reate_completion_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x06 \x03(\x0b\x32/.google.cloud.alloydb.v1beta.Backup.LabelsEntry\x12=\n\x05state\x18\x07 \x01(\x0e\x32).google.cloud.alloydb.v1beta.Backup.StateB\x03\xe0\x41\x03\x12\x36\n\x04type\x18\x08 \x01(\x0e\x32(.google.cloud.alloydb.v1beta.Backup.Type\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12\x18\n\x0b\x63luster_uid\x18\x12 \x01(\tB\x03\xe0\x41\x03\x12<\n\x0c\x63luster_name\x18\n \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x18\n\x0breconciling\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03\x12M\n\x11\x65ncryption_config\x18\x0c \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12I\n\x0f\x65ncryption_info\x18\r \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0e \x01(\t\x12I\n\x0b\x61nnotations\x18\x10 \x03(\x0b\x32\x34.google.cloud.alloydb.v1beta.Backup.AnnotationsEntry\x12\x17\n\nsize_bytes\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpiry_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x0f\x65xpiry_quantity\x18\x14 \x01(\x0b\x32\x37.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiryB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x15 \x01(\x08\x42\x03\xe0\x41\x03\x12K\n\x10\x64\x61tabase_version\x18\x16 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\x03\xe0\x41\x03\x12\x46\n\x04tags\x18\x19 \x03(\x0b\x32-.google.cloud.alloydb.v1beta.Backup.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1aW\n\x13QuantityBasedExpiry\x12\x1c\n\x0fretention_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\"\n\x15total_retention_count\x18\x02 \x01(\x05\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\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"J\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\x12\x0e\n\nCONTINUOUS\x10\x03:p\xea\x41m\n\x1d\x61lloydb.googleapis.com/Backup\x12\x38projects/{project}/locations/{location}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kupR\x01\x01\"\x90\t\n\x15SupportedDatabaseFlag\x12\x64\n\x13string_restrictions\x18\x07 \x01(\x0b\x32\x45.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsH\x00\x12\x66\n\x14integer_restrictions\x18\x08 \x01(\x0b\x32\x46.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsH\x00\x12\"\n\x18recommended_string_value\x18\n \x01(\tH\x01\x12@\n\x19recommended_integer_value\x18\x0b \x01(\x0b\x32\x1b.google.protobuf.Int64ValueH\x01\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tflag_name\x18\x02 \x01(\t\x12P\n\nvalue_type\x18\x03 \x01(\x0e\x32<.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType\x12\x1f\n\x17\x61\x63\x63\x65pts_multiple_values\x18\x04 \x01(\x08\x12K\n\x15supported_db_versions\x18\x05 \x03(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12\x1b\n\x13requires_db_restart\x18\x06 \x01(\x08\x12G\n\x05scope\x18\t \x01(\x0e\x32\x38.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope\x1a,\n\x12StringRestrictions\x12\x16\n\x0e\x61llowed_values\x18\x01 \x03(\t\x1au\n\x13IntegerRestrictions\x12.\n\tmin_value\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12.\n\tmax_value\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"U\n\tValueType\x12\x1a\n\x16VALUE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\x0b\n\x07INTEGER\x10\x02\x12\t\n\x05\x46LOAT\x10\x03\x12\x08\n\x04NONE\x10\x04\"A\n\x05Scope\x12\x15\n\x11SCOPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44\x41TABASE\x10\x01\x12\x13\n\x0f\x43ONNECTION_POOL\x10\x02:\x97\x01\xea\x41\x93\x01\n,alloydb.googleapis.com/SupportedDatabaseFlag\x12\x34projects/{project}/locations/{location}/flags/{flag}*\x16supportedDatabaseFlags2\x15supportedDatabaseFlagB\x0e\n\x0crestrictionsB\x13\n\x11recommended_value\"\xfe\x02\n\x04User\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08password\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x1b\n\x0e\x64\x61tabase_roles\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x42\n\tuser_type\x18\x05 \x01(\x0e\x32*.google.cloud.alloydb.v1beta.User.UserTypeB\x03\xe0\x41\x01\x12\x1d\n\x10keep_extra_roles\x18\x06 \x01(\x08\x42\x03\xe0\x41\x04\"Q\n\x08UserType\x12\x19\n\x15USER_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41LLOYDB_BUILT_IN\x10\x01\x12\x14\n\x10\x41LLOYDB_IAM_USER\x10\x02:y\xea\x41v\n\x1b\x61lloydb.googleapis.com/User\x12Gprojects/{project}/locations/{location}/clusters/{cluster}/users/{user}*\x05users2\x04userR\x01\x01\"\x82\x03\n\x08\x44\x61tabase\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x17\n\x07\x63harset\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x19\n\tcollation\x18\x03 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1e\n\x0e\x63haracter_type\x18\x04 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1a\n\x0bis_template\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12!\n\x11\x64\x61tabase_template\x18\x06 \x01(\tB\x06\xe0\x41\x04\xe0\x41\x05\x12&\n\x14is_template_database\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01:\x8e\x01\xea\x41\x8a\x01\n\x1f\x61lloydb.googleapis.com/Database\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/databases/{database}*\tdatabases2\x08\x64\x61tabaseR\x01\x01\x42\x17\n\x15_is_template_database*^\n\x0cInstanceView\x12\x1d\n\x19INSTANCE_VIEW_UNSPECIFIED\x10\x00\x12\x17\n\x13INSTANCE_VIEW_BASIC\x10\x01\x12\x16\n\x12INSTANCE_VIEW_FULL\x10\x02*g\n\x0b\x43lusterView\x12\x1c\n\x18\x43LUSTER_VIEW_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43LUSTER_VIEW_BASIC\x10\x01\x12\"\n\x1e\x43LUSTER_VIEW_CONTINUOUS_BACKUP\x10\x02*\x9d\x01\n\x0f\x44\x61tabaseVersion\x12 \n\x1c\x44\x41TABASE_VERSION_UNSPECIFIED\x10\x00\x12\x13\n\x0bPOSTGRES_13\x10\x01\x1a\x02\x08\x01\x12\x0f\n\x0bPOSTGRES_14\x10\x02\x12\x0f\n\x0bPOSTGRES_15\x10\x03\x12\x0f\n\x0bPOSTGRES_16\x10\x04\x12\x0f\n\x0bPOSTGRES_17\x10\x05\x12\x0f\n\x0bPOSTGRES_18\x10\x06*N\n\x10SubscriptionType\x12!\n\x1dSUBSCRIPTION_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\t\n\x05TRIAL\x10\x02\x42\xbb\x05\n\x1f\x63om.google.cloud.alloydb.v1betaB\x0eResourcesProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1beta\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool diff --git a/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb b/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb index c7ca1a6bdbe9..36f4d375e8ec 100644 --- a/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb +++ b/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb @@ -1776,6 +1776,9 @@ module DatabaseVersion # The database version is Postgres 17. POSTGRES_17 = 5 + + # The database version is Postgres 18. + POSTGRES_18 = 6 end # Subscription_type added to distinguish between Standard and Trial diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/.gitignore b/owl-bot-staging/google-cloud-alloy_db-v1beta/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/.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-alloy_db-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-alloy_db-v1beta/.repo-metadata.json deleted file mode 100644 index fa2c90a7068f..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "alloydb.googleapis.com", - "api_shortname": "alloydb", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-alloy_db-v1beta/latest", - "distribution_name": "google-cloud-alloy_db-v1beta", - "is_cloud": true, - "language": "ruby", - "name": "alloydb", - "name_pretty": "AlloyDB V1BETA API", - "product_documentation": "https://cloud.google.com/alloydb/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. Note that google-cloud-alloy_db-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-alloy_db instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/alloydb/docs", - "ruby-cloud-service-override": "AlloyDBCSQLAdmin=AlloyDBCloudSQLAdmin", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-alloy_db-v1beta/.rubocop.yml deleted file mode 100644 index 5990f34b62b1..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-alloy_db-v1beta.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-alloy_db-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/.toys.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/.toys.rb deleted file mode 100644 index 9a210f1427c7..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -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-alloy_db-v1beta/.yardopts b/owl-bot-staging/google-cloud-alloy_db-v1beta/.yardopts deleted file mode 100644 index 3b974a03f407..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="AlloyDB V1BETA 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-alloy_db-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-alloy_db-v1beta/AUTHENTICATION.md deleted file mode 100644 index 8cd16e98873b..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-alloy_db-v1beta 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-alloy_db-v1beta 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/alloy_db/v1beta" - -client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/alloy_db/v1beta" - -::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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-alloy_db-v1beta -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/alloy_db/v1beta" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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-alloy_db-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-alloy_db-v1beta/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/Gemfile b/owl-bot-staging/google-cloud-alloy_db-v1beta/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-alloy_db-v1beta/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/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-alloy_db-v1beta/README.md b/owl-bot-staging/google-cloud-alloy_db-v1beta/README.md deleted file mode 100644 index 45aa9fde926f..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the AlloyDB V1BETA API - -AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. - -AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the AlloyDB V1BETA API. Most users should consider using -the main client gem, -[google-cloud-alloy_db](https://rubygems.org/gems/google-cloud-alloy_db). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-alloy_db-v1beta -``` - -## 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/alloydb.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/alloy_db/v1beta" - -client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new -request = ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.new # (request fields as keyword arguments...) -response = client.list_clusters request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-alloy_db-v1beta/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/alloydb/docs) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/alloy_db/v1beta" -require "logger" - -client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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-alloy_db`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-alloy_db-v1beta`. -_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-alloy_db`. -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-alloy_db-v1beta`. - -### 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-alloy_db-v1beta/Rakefile b/owl-bot-staging/google-cloud-alloy_db-v1beta/Rakefile deleted file mode 100644 index bcbdda50d8bc..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -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-alloy_db-v1beta 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/alloy_db/v1beta/alloy_db_admin/credentials" - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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-alloy_db-v1beta 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-alloy_db-v1beta 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-alloy_db-v1beta 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-alloy_db-v1beta gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-alloy_db-v1beta" - header "google-cloud-alloy_db-v1beta rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-alloy_db-v1beta yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-alloy_db-v1beta 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-alloy_db-v1beta 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-alloy_db-v1beta 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-alloy_db-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-alloy_db-v1beta/gapic_metadata.json deleted file mode 100644 index 7dd3dd41eaf9..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/gapic_metadata.json +++ /dev/null @@ -1,222 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.alloydb.v1beta", - "libraryPackage": "::Google::Cloud::AlloyDB::V1beta", - "services": { - "AlloyDBAdmin": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client", - "rpcs": { - "ListClusters": { - "methods": [ - "list_clusters" - ] - }, - "GetCluster": { - "methods": [ - "get_cluster" - ] - }, - "CreateCluster": { - "methods": [ - "create_cluster" - ] - }, - "UpdateCluster": { - "methods": [ - "update_cluster" - ] - }, - "ExportCluster": { - "methods": [ - "export_cluster" - ] - }, - "ImportCluster": { - "methods": [ - "import_cluster" - ] - }, - "UpgradeCluster": { - "methods": [ - "upgrade_cluster" - ] - }, - "DeleteCluster": { - "methods": [ - "delete_cluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promote_cluster" - ] - }, - "SwitchoverCluster": { - "methods": [ - "switchover_cluster" - ] - }, - "RestoreCluster": { - "methods": [ - "restore_cluster" - ] - }, - "CreateSecondaryCluster": { - "methods": [ - "create_secondary_cluster" - ] - }, - "ListInstances": { - "methods": [ - "list_instances" - ] - }, - "GetInstance": { - "methods": [ - "get_instance" - ] - }, - "CreateInstance": { - "methods": [ - "create_instance" - ] - }, - "CreateSecondaryInstance": { - "methods": [ - "create_secondary_instance" - ] - }, - "BatchCreateInstances": { - "methods": [ - "batch_create_instances" - ] - }, - "UpdateInstance": { - "methods": [ - "update_instance" - ] - }, - "DeleteInstance": { - "methods": [ - "delete_instance" - ] - }, - "FailoverInstance": { - "methods": [ - "failover_instance" - ] - }, - "InjectFault": { - "methods": [ - "inject_fault" - ] - }, - "RestartInstance": { - "methods": [ - "restart_instance" - ] - }, - "ExecuteSql": { - "methods": [ - "execute_sql" - ] - }, - "ListBackups": { - "methods": [ - "list_backups" - ] - }, - "GetBackup": { - "methods": [ - "get_backup" - ] - }, - "CreateBackup": { - "methods": [ - "create_backup" - ] - }, - "UpdateBackup": { - "methods": [ - "update_backup" - ] - }, - "DeleteBackup": { - "methods": [ - "delete_backup" - ] - }, - "ListSupportedDatabaseFlags": { - "methods": [ - "list_supported_database_flags" - ] - }, - "GenerateClientCertificate": { - "methods": [ - "generate_client_certificate" - ] - }, - "GetConnectionInfo": { - "methods": [ - "get_connection_info" - ] - }, - "ListUsers": { - "methods": [ - "list_users" - ] - }, - "GetUser": { - "methods": [ - "get_user" - ] - }, - "CreateUser": { - "methods": [ - "create_user" - ] - }, - "UpdateUser": { - "methods": [ - "update_user" - ] - }, - "DeleteUser": { - "methods": [ - "delete_user" - ] - }, - "ListDatabases": { - "methods": [ - "list_databases" - ] - }, - "CreateDatabase": { - "methods": [ - "create_database" - ] - } - } - } - } - }, - "AlloyDBCSQLAdmin": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client", - "rpcs": { - "RestoreFromCloudSQL": { - "methods": [ - "restore_from_cloud_sql" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/google-cloud-alloy_db-v1beta.gemspec b/owl-bot-staging/google-cloud-alloy_db-v1beta/google-cloud-alloy_db-v1beta.gemspec deleted file mode 100644 index a9baf96ac0c9..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/google-cloud-alloy_db-v1beta.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/alloy_db/v1beta/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-alloy_db-v1beta" - gem.version = Google::Cloud::AlloyDB::V1beta::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases. Note that google-cloud-alloy_db-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-alloy_db instead. See the readme for more details." - gem.summary = "AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "google-iam-v1", "~> 1.3" -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google-cloud-alloy_db-v1beta.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google-cloud-alloy_db-v1beta.rb deleted file mode 100644 index 021f5a816c80..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google-cloud-alloy_db-v1beta.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/alloy_db/v1beta" diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta.rb deleted file mode 100644 index d548aa8a53e8..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/alloy_db/v1beta/alloy_db_admin" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" -require "google/cloud/alloy_db/v1beta/version" - -module Google - module Cloud - module AlloyDB - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/alloy_db/v1beta" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/alloy_db/v1beta" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - module V1beta - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" -require "google/cloud/alloy_db/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb deleted file mode 100644 index 03f5407b84c4..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/alloy_db/v1beta/version" - -require "google/cloud/alloy_db/v1beta/alloy_db_admin/credentials" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/paths" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/operations" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/client" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" - -module Google - module Cloud - module AlloyDB - module V1beta - ## - # Service describing handlers for resources - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/alloy_db/v1beta/alloy_db_admin" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - module AlloyDBAdmin - end - end - end - end -end - -helper_path = ::File.join __dir__, "alloy_db_admin", "helpers.rb" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb deleted file mode 100644 index c2276c68406f..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/client.rb +++ /dev/null @@ -1,4929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/alloydb/v1beta/service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBAdmin - ## - # Client for the AlloyDBAdmin service. - # - # Service describing handlers for resources - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :alloy_db_admin_stub - - ## - # Configure the AlloyDBAdmin Client class. - # - # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AlloyDBAdmin clients - # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "AlloyDB", "V1beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_clusters.timeout = 60.0 - default_config.rpcs.list_clusters.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_cluster.timeout = 60.0 - default_config.rpcs.get_cluster.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_instances.timeout = 60.0 - default_config.rpcs.list_instances.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_instance.timeout = 60.0 - default_config.rpcs.get_instance.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_backups.timeout = 60.0 - default_config.rpcs.list_backups.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_backup.timeout = 60.0 - default_config.rpcs.get_backup.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_supported_database_flags.timeout = 60.0 - default_config.rpcs.list_supported_database_flags.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.generate_client_certificate.timeout = 60.0 - default_config.rpcs.generate_client_certificate.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_connection_info.timeout = 60.0 - default_config.rpcs.get_connection_info.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_users.timeout = 60.0 - default_config.rpcs.list_users.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_user.timeout = 60.0 - default_config.rpcs.get_user.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_databases.timeout = 60.0 - default_config.rpcs.list_databases.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_database.timeout = 60.0 - default_config.rpcs.create_database.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 AlloyDBAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @alloy_db_admin_stub.universe_domain - end - - ## - # Create a new AlloyDBAdmin client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AlloyDBAdmin 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/alloydb/v1beta/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 - - @alloy_db_admin_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Stub, - credentials: credentials, - endpoint: @config.endpoint, - 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 - ) - - @alloy_db_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 - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @alloy_db_admin_stub.endpoint - config.universe_domain = @alloy_db_admin_stub.universe_domain - config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @alloy_db_admin_stub.endpoint - config.universe_domain = @alloy_db_admin_stub.universe_domain - config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @alloy_db_admin_stub.logger - end - - # Service calls - - ## - # Lists Clusters in a given project and location. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Cluster.name field. Additionally, you can perform an - # aggregated list operation by specifying a value with the following format: - # * projects/\\{project}/locations/- - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results - # @param order_by [::String] - # Optional. Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Cluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Cluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_clusters.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :list_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_clusters, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single Cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_cluster(name: nil, view: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field. - # @param view [::Google::Cloud::AlloyDB::V1beta::ClusterView] - # Optional. The view of the cluster to return. Returns all default fields if - # not set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::Cluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :get_cluster, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new Cluster in a given project and location. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of the new cluster. For the required format, see the - # comment on the Cluster.name field. - # @param cluster_id [::String] - # Required. ID of the requesting object. - # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :create_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the parameters of a single Cluster. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Cluster 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 cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param allow_missing [::Boolean] - # Optional. If set to true, update succeeds even if cluster is not found. In - # that case, a new cluster is created and `update_mask` is ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.cluster&.name - header_params["cluster.name"] = request.cluster.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :update_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports data from the cluster. - # Imperative only. - # - # @overload export_cluster(request, options = nil) - # Pass arguments to `export_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_cluster(gcs_destination: nil, csv_export_options: nil, sql_export_options: nil, name: nil, database: nil) - # Pass arguments to `export_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_destination [::Google::Cloud::AlloyDB::V1beta::GcsDestination, ::Hash] - # Required. Option to export data to cloud storage. - # @param csv_export_options [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::CsvExportOptions, ::Hash] - # Options for exporting data in CSV format. Required field to be set for - # CSV file type. - # - # Note: The following parameters are mutually exclusive: `csv_export_options`, `sql_export_options`. 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 sql_export_options [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::SqlExportOptions, ::Hash] - # Options for exporting data in SQL format. Required field to be set for - # SQL file type. - # - # Note: The following parameters are mutually exclusive: `sql_export_options`, `csv_export_options`. 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 name [::String] - # Required. The resource name of the cluster. - # @param database [::String] - # Required. Name of the database where the export command will be executed. - # Note - Value provided should be the same as expected from - # `SELECT current_database();` and NOT as a resource reference. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new - # - # # Call the export_cluster method. - # result = client.export_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.export_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.export_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :export_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports data to the cluster. - # Imperative only. - # - # @overload import_cluster(request, options = nil) - # Pass arguments to `import_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload import_cluster(sql_import_options: nil, csv_import_options: nil, name: nil, gcs_uri: nil, database: nil, user: nil) - # Pass arguments to `import_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param sql_import_options [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::SqlImportOptions, ::Hash] - # Options for importing data in SQL format. - # - # Note: The following parameters are mutually exclusive: `sql_import_options`, `csv_import_options`. 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 csv_import_options [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::CsvImportOptions, ::Hash] - # Options for importing data in CSV format. - # - # Note: The following parameters are mutually exclusive: `csv_import_options`, `sql_import_options`. 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 name [::String] - # Required. The resource name of the cluster. - # @param gcs_uri [::String] - # Required. The path to the file in Google Cloud Storage where the source - # file for import will be stored. The URI is in the form - # `gs://bucketName/fileName`. - # @param database [::String] - # Optional. Name of the database to which the import will be done. - # For import from SQL file, this is required only if the file does not - # specify a database. - # Note - Value provided should be the same as expected from `SELECT - # current_database();` and NOT as a resource reference. - # @param user [::String] - # Optional. Database user to be used for importing the data. - # Note - Value provided should be the same as expected from - # `SELECT current_user;` and NOT as a resource reference. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new - # - # # Call the import_cluster method. - # result = client.import_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.import_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.import_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :import_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Upgrades a single Cluster. - # Imperative only. - # - # @overload upgrade_cluster(request, options = nil) - # Pass arguments to `upgrade_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload upgrade_cluster(name: nil, version: nil, request_id: nil, validate_only: nil, etag: nil) - # Pass arguments to `upgrade_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the cluster. - # @param version [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] - # Required. The version the cluster is going to be upgraded to. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param etag [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # upgrade will be blocked and an ABORTED error will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new - # - # # Call the upgrade_cluster method. - # result = client.upgrade_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def upgrade_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.upgrade_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.upgrade_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.upgrade_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :upgrade_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single Cluster. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil, force: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param etag [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # deletion will be blocked and an ABORTED error will be returned. - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param force [::Boolean] - # Optional. Whether to cascade delete child instances for given cluster. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :delete_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Promotes a SECONDARY cluster. This turns down replication - # from the PRIMARY cluster and promotes a secondary cluster - # into its own standalone cluster. - # Imperative only. - # - # @overload promote_cluster(request, options = nil) - # Pass arguments to `promote_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil) - # Pass arguments to `promote_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param etag [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # deletion will be blocked and an ABORTED error will be returned. - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new - # - # # Call the promote_cluster method. - # result = client.promote_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def promote_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.promote_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.promote_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :promote_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Switches the roles of PRIMARY and SECONDARY clusters without any data loss. - # This promotes the SECONDARY cluster to PRIMARY and sets up the original - # PRIMARY cluster to replicate from this newly promoted cluster. - # - # @overload switchover_cluster(request, options = nil) - # Pass arguments to `switchover_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload switchover_cluster(name: nil, request_id: nil, validate_only: nil) - # Pass arguments to `switchover_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new - # - # # Call the switchover_cluster method. - # result = client.switchover_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def switchover_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.switchover_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.switchover_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.switchover_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :switchover_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new Cluster in a given project and location, with a volume - # restored from the provided source, either a backup ID or a point-in-time - # and a source cluster. - # - # @overload restore_cluster(request, options = nil) - # Pass arguments to `restore_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `restore_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param backup_source [::Google::Cloud::AlloyDB::V1beta::BackupSource, ::Hash] - # Backup source. - # - # Note: The following parameters are mutually exclusive: `backup_source`, `continuous_backup_source`. 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 continuous_backup_source [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupSource, ::Hash] - # ContinuousBackup source. Continuous backup needs to be enabled in the - # source cluster for this operation to succeed. - # - # Note: The following parameters are mutually exclusive: `continuous_backup_source`, `backup_source`. 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 parent [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Cluster.name field. - # @param cluster_id [::String] - # Required. ID of the requesting object. - # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new - # - # # Call the restore_cluster method. - # result = client.restore_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def restore_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest - - # Converts hash and nil to 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_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.restore_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :restore_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a cluster of type SECONDARY in the given location using - # the primary cluster as the source. - # - # @overload create_secondary_cluster(request, options = nil) - # Pass arguments to `create_secondary_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of the new cluster. For the required - # format, see the comment on the Cluster.name field. - # @param cluster_id [::String] - # Required. ID of the requesting object (the secondary cluster). - # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash] - # Required. Configuration of the requesting object (the secondary cluster). - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new - # - # # Call the create_secondary_cluster method. - # result = client.create_secondary_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_secondary_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_secondary_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_secondary_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :create_secondary_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists Instances in a given project and location. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Instance.name field. Additionally, you can perform an - # aggregated list operation by specifying a value with one of the following - # formats: - # * projects/\\{project}/locations/-/clusters/- - # * projects/\\{project}/locations/\\{region}/clusters/- - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results - # @param order_by [::String] - # Optional. Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Instance>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Instance>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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 - - @alloy_db_admin_stub.call_rpc :list_instances, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @alloy_db_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 - - ## - # Gets details of a single Instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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, view: 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 resource. For the required format, see the - # comment on the Instance.name field. - # @param view [::Google::Cloud::AlloyDB::V1beta::InstanceView] - # The view of the instance to return. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::Instance] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Instance] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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 - - @alloy_db_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 a new Instance in a given project and location. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: 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 parent resource. For the required format, see the - # comment on the Instance.name field. - # @param instance_id [::String] - # Required. ID of the requesting object. - # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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 - - @alloy_db_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 - - ## - # Creates a new SECONDARY Instance in a given project and location. - # - # @overload create_secondary_instance(request, options = nil) - # Pass arguments to `create_secondary_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_secondary_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 parent resource. For the required format, see the - # comment on the Instance.name field. - # @param instance_id [::String] - # Required. ID of the requesting object. - # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new - # - # # Call the create_secondary_instance method. - # result = client.create_secondary_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_secondary_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_secondary_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_secondary_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :create_secondary_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 - - ## - # Creates new instances under the given project, location and cluster. - # There can be only one primary instance in a cluster. If the primary - # instance exists in the cluster as well as this request, then API will - # throw an error. - # The primary instance should exist before any read pool instance is - # created. If the primary instance is a part of the request payload, then - # the API will take care of creating instances in the correct order. - # This method is here to support Google-internal use cases, and is not meant - # for external customers to consume. Please do not start relying on it; its - # behavior is subject to change without notice. - # - # @overload batch_create_instances(request, options = nil) - # Pass arguments to `batch_create_instances` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, requests: nil, request_id: nil) - # Pass arguments to `batch_create_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 parent resource. - # @param requests [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests, ::Hash] - # Required. Resources 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new - # - # # Call the batch_create_instances method. - # result = client.batch_create_instances request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest - - # Converts hash and nil to 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_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :batch_create_instances, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 parameters of a single Instance. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_instance(update_mask: nil, instance: nil, request_id: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Instance 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 instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param allow_missing [::Boolean] - # Optional. If set to true, update succeeds even if instance is not found. In - # that case, a new instance is created and `update_mask` is ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-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 - - @alloy_db_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 a single Instance. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_instance(name: nil, request_id: nil, etag: nil, validate_only: 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 resource. For the required format, see the - # comment on the Instance.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param etag [::String] - # Optional. The current etag of the Instance. - # If an etag is provided and does not match the current etag of the Instance, - # deletion will be blocked and an ABORTED error will be returned. - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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 - - @alloy_db_admin_stub.call_rpc :delete_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a Failover for a highly available instance. - # Failover promotes the HA standby instance as the new primary. - # Imperative only. - # - # @overload failover_instance(request, options = nil) - # Pass arguments to `failover_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload failover_instance(name: nil, request_id: nil, validate_only: nil) - # Pass arguments to `failover_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new - # - # # Call the failover_instance method. - # result = client.failover_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def failover_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.failover_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.failover_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.failover_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :failover_instance, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Injects fault in an instance. - # Imperative only. - # - # @overload inject_fault(request, options = nil) - # Pass arguments to `inject_fault` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil) - # Pass arguments to `inject_fault` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param fault_type [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest::FaultType] - # Required. The type of fault to be injected in an instance. - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new - # - # # Call the inject_fault method. - # result = client.inject_fault request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def inject_fault request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.inject_fault.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.inject_fault.timeout, - metadata: metadata, - retry_policy: @config.rpcs.inject_fault.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :inject_fault, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Restart an Instance in a cluster. - # Imperative only. - # - # @overload restart_instance(request, options = nil) - # Pass arguments to `restart_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload restart_instance(name: nil, request_id: nil, validate_only: nil, node_ids: nil) - # Pass arguments to `restart_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 resource. For the required format, see the - # comment on the Instance.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param node_ids [::Array<::String>] - # Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - # restart upon. Applicable only to read 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new - # - # # Call the restart_instance method. - # result = client.restart_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 restart_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.restart_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.restart_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.restart_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :restart_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 - - ## - # Executes a SQL statement in a database inside an AlloyDB instance. - # - # @overload execute_sql(request, options = nil) - # Pass arguments to `execute_sql` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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(password: nil, instance: nil, database: nil, user: nil, sql_statement: nil, validate_only: 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 password [::String] - # Optional. The database native user’s password. - # @param instance [::String] - # Required. The instance where the SQL will be executed. For the required - # format, see the comment on the Instance.name field. - # @param database [::String] - # Required. Name of the database where the query will be executed. - # Note - Value provided should be the same as expected from `SELECT - # current_database();` and NOT as a resource reference. - # @param user [::String] - # Required. Database user to be used for executing the SQL. - # Note - Value provided should be the same as expected from - # `SELECT current_user;` and NOT as a resource reference. - # @param sql_statement [::String] - # Required. SQL statement to execute on database. Any valid statement is - # permitted, including DDL, DML, DQL statements. - # @param validate_only [::Boolean] - # Optional. If set, validates the sql statement by performing - # syntax and semantic validation and doesn't execute the query. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new - # - # # Call the execute_sql method. - # result = client.execute_sql request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse. - # 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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-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 - header_params["instance"] = request.instance - end - - request_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 - - @alloy_db_admin_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 - - ## - # Lists Backups in a given project and location. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: 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. Parent value for ListBackupsRequest - # @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::AlloyDB::V1beta::Backup>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Backup>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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 - - @alloy_db_admin_stub.call_rpc :list_backups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @alloy_db_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 - - ## - # Gets details of a single Backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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 resource - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::Backup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Backup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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 - - @alloy_db_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 - - ## - # Creates a new Backup in a given project and location. - # - # @overload create_backup(request, options = nil) - # Pass arguments to `create_backup` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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, request_id: nil, validate_only: 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. Value for parent. - # @param backup_id [::String] - # Required. ID of the requesting object. - # @param backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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 - - @alloy_db_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 - - ## - # Updates the parameters of a single Backup. - # - # @overload update_backup(request, options = nil) - # Pass arguments to `update_backup` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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(update_mask: nil, backup: nil, request_id: nil, validate_only: nil, allow_missing: 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Backup 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 backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @param allow_missing [::Boolean] - # Optional. If set to true, update succeeds even if instance is not found. In - # that case, a new backup is created and `update_mask` is ignored. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new - # - # # Call the update_backup method. - # result = client.update_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 update_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-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 - - @alloy_db_admin_stub.call_rpc :update_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 - - ## - # Deletes a single Backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_backup(name: nil, request_id: nil, validate_only: nil, etag: 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 resource. For the required format, see the comment on - # the Backup.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @param etag [::String] - # Optional. The current etag of the Backup. - # If an etag is provided and does not match the current etag of the Backup, - # deletion will be blocked and an ABORTED error will be returned. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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 - - @alloy_db_admin_stub.call_rpc :delete_backup, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists SupportedDatabaseFlags for a given project and location. - # - # @overload list_supported_database_flags(request, options = nil) - # Pass arguments to `list_supported_database_flags` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_supported_database_flags(parent: nil, page_size: nil, page_token: nil, scope: nil) - # Pass arguments to `list_supported_database_flags` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. The required format is: - # * projects/\\{project}/locations/\\{location} - # - # Regardless of the parent specified here, as long it is contains a valid - # project and location, the service will return a static list of supported - # flags resources. Note that we do not yet support region-specific - # flags. - # @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 scope [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::Scope] - # Optional. The scope for which supported flags are requested. If not - # specified, default is DATABASE. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new - # - # # Call the list_supported_database_flags method. - # result = client.list_supported_database_flags request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag. - # p item - # end - # - def list_supported_database_flags request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_supported_database_flags.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_supported_database_flags.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_supported_database_flags.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :list_supported_database_flags, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Generate a client certificate signed by a Cluster CA. - # The sole purpose of this endpoint is to support AlloyDB connectors and the - # Auth Proxy client. The endpoint's behavior is subject to change without - # notice, so do not rely on its behavior remaining constant. Future changes - # will not break AlloyDB connectors or the Auth Proxy client. - # - # @overload generate_client_certificate(request, options = nil) - # Pass arguments to `generate_client_certificate` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil, public_key: nil, use_metadata_exchange: nil) - # Pass arguments to `generate_client_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. The required format is: - # * projects/\\{project}/locations/\\{location}/clusters/\\{cluster} - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param pem_csr [::String] - # Optional. A pem-encoded X.509 certificate signing request (CSR). It is - # recommended to use public_key instead. - # @param cert_duration [::Google::Protobuf::Duration, ::Hash] - # Optional. An optional hint to the endpoint to generate the client - # certificate with the requested duration. The duration can be from 1 hour to - # 24 hours. The endpoint may or may not honor the hint. If the hint is left - # unspecified or is not honored, then the endpoint will pick an appropriate - # default duration. - # @param public_key [::String] - # Optional. The public key from the client. - # @param use_metadata_exchange [::Boolean] - # Optional. An optional hint to the endpoint to generate a client certificate - # that can be used by AlloyDB connectors to exchange additional metadata with - # the server after TLS handshake. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new - # - # # Call the generate_client_certificate method. - # result = client.generate_client_certificate request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse. - # p result - # - def generate_client_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest - - # Converts hash and nil to 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_client_certificate.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.generate_client_certificate.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_client_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :generate_client_certificate, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get instance metadata used for a connection. - # - # @overload get_connection_info(request, options = nil) - # Pass arguments to `get_connection_info` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_connection_info(parent: nil, request_id: nil) - # Pass arguments to `get_connection_info` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. The required format is: - # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance} - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate 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::AlloyDB::V1beta::ConnectionInfo] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new - # - # # Call the get_connection_info method. - # result = client.get_connection_info request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::ConnectionInfo. - # p result - # - def get_connection_info request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_connection_info.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_connection_info.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_connection_info.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :get_connection_info, request, 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 Users in a given project and location. - # - # @overload list_users(request, options = nil) - # Pass arguments to `list_users` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListUsersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_users` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 ListUsersRequest - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results - # @param order_by [::String] - # Optional. Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::User>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::User>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ListUsersRequest.new - # - # # Call the list_users method. - # result = client.list_users request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::User. - # p item - # end - # - def list_users request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_users.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_users.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_users.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :list_users, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_users, request, response, 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 User. - # - # @overload get_user(request, options = nil) - # Pass arguments to `get_user` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetUserRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::GetUserRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_user(name: nil) - # Pass arguments to `get_user` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the User.name field. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetUserRequest.new - # - # # Call the get_user method. - # result = client.get_user request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - # p result - # - def get_user request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetUserRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_user.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_user.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_user.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :get_user, request, 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 User in a given project, location, and cluster. - # - # @overload create_user(request, options = nil) - # Pass arguments to `create_user` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateUserRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_user` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 user_id [::String] - # Required. ID of the requesting object. - # @param user [::Google::Cloud::AlloyDB::V1beta::User, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new - # - # # Call the create_user method. - # result = client.create_user request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - # p result - # - def create_user request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_user.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_user.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_user.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :create_user, request, 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 User. - # - # @overload update_user(request, options = nil) - # Pass arguments to `update_user` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_user` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # User 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 user [::Google::Cloud::AlloyDB::V1beta::User, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @param allow_missing [::Boolean] - # Optional. Allow missing fields in the update mask. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new - # - # # Call the update_user method. - # result = client.update_user request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - # p result - # - def update_user request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_user.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.user&.name - header_params["user.name"] = request.user.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_user.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_user.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :update_user, request, 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 User. - # - # @overload delete_user(request, options = nil) - # Pass arguments to `delete_user` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_user(name: nil, request_id: nil, validate_only: nil) - # Pass arguments to `delete_user` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the User.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new - # - # # Call the delete_user method. - # result = client.delete_user request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_user request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_user.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_user.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_user.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.call_rpc :delete_user, request, 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 Databases in a given project and location. - # - # @overload list_databases(request, options = nil) - # Pass arguments to `list_databases` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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, filter: 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. Parent value for ListDatabasesRequest. - # @param page_size [::Integer] - # Optional. The maximum number of databases to return. The service may return - # fewer than this value. If unspecified, 2000 is the default page_size. The - # max value of page_size will be 4000, values above max will be coerced to - # max. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListDatabases` call. - # This should be provided to retrieve the subsequent page. - # This field is currently not supported, its value will be ignored if passed. - # @param filter [::String] - # Optional. Filtering results. - # This field is currently not supported, its value will be ignored if passed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Database>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Database>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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 - - @alloy_db_admin_stub.call_rpc :list_databases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @alloy_db_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 Database in a given project, location, and cluster. - # - # @overload create_database(request, options = nil) - # Pass arguments to `create_database` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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, database_id: nil, database: 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. Value for parent. - # @param database_id [::String] - # Required. ID of the requesting object. - # @param database [::Google::Cloud::AlloyDB::V1beta::Database, ::Hash] - # Required. The resource being created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::AlloyDB::V1beta::Database] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Database] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new - # - # # Call the create_database method. - # result = client.create_database request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::Database. - # p result - # - def create_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_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 - - @alloy_db_admin_stub.call_rpc :create_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 - - ## - # Configuration class for the AlloyDBAdmin API. - # - # This class represents the configuration for AlloyDBAdmin, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "alloydb.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the AlloyDBAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `export_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :export_cluster - ## - # RPC-specific configuration for `import_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :import_cluster - ## - # RPC-specific configuration for `upgrade_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :upgrade_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `promote_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :promote_cluster - ## - # RPC-specific configuration for `switchover_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :switchover_cluster - ## - # RPC-specific configuration for `restore_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_cluster - ## - # RPC-specific configuration for `create_secondary_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secondary_cluster - ## - # RPC-specific configuration for `list_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `create_secondary_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secondary_instance - ## - # RPC-specific configuration for `batch_create_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_instances - ## - # 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 `failover_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :failover_instance - ## - # RPC-specific configuration for `inject_fault` - # @return [::Gapic::Config::Method] - # - attr_reader :inject_fault - ## - # RPC-specific configuration for `restart_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :restart_instance - ## - # RPC-specific configuration for `execute_sql` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_sql - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `create_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :create_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_supported_database_flags` - # @return [::Gapic::Config::Method] - # - attr_reader :list_supported_database_flags - ## - # RPC-specific configuration for `generate_client_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_client_certificate - ## - # RPC-specific configuration for `get_connection_info` - # @return [::Gapic::Config::Method] - # - attr_reader :get_connection_info - ## - # RPC-specific configuration for `list_users` - # @return [::Gapic::Config::Method] - # - attr_reader :list_users - ## - # RPC-specific configuration for `get_user` - # @return [::Gapic::Config::Method] - # - attr_reader :get_user - ## - # RPC-specific configuration for `create_user` - # @return [::Gapic::Config::Method] - # - attr_reader :create_user - ## - # RPC-specific configuration for `update_user` - # @return [::Gapic::Config::Method] - # - attr_reader :update_user - ## - # RPC-specific configuration for `delete_user` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_user - ## - # 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 - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - export_cluster_config = parent_rpcs.export_cluster if parent_rpcs.respond_to? :export_cluster - @export_cluster = ::Gapic::Config::Method.new export_cluster_config - import_cluster_config = parent_rpcs.import_cluster if parent_rpcs.respond_to? :import_cluster - @import_cluster = ::Gapic::Config::Method.new import_cluster_config - upgrade_cluster_config = parent_rpcs.upgrade_cluster if parent_rpcs.respond_to? :upgrade_cluster - @upgrade_cluster = ::Gapic::Config::Method.new upgrade_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster - @promote_cluster = ::Gapic::Config::Method.new promote_cluster_config - switchover_cluster_config = parent_rpcs.switchover_cluster if parent_rpcs.respond_to? :switchover_cluster - @switchover_cluster = ::Gapic::Config::Method.new switchover_cluster_config - restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster - @restore_cluster = ::Gapic::Config::Method.new restore_cluster_config - create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster - @create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance - @create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config - batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances - @batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_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 - failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance - @failover_instance = ::Gapic::Config::Method.new failover_instance_config - inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault - @inject_fault = ::Gapic::Config::Method.new inject_fault_config - restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance - @restart_instance = ::Gapic::Config::Method.new restart_instance_config - execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql - @execute_sql = ::Gapic::Config::Method.new execute_sql_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup - @create_backup = ::Gapic::Config::Method.new create_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_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags - @list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config - generate_client_certificate_config = parent_rpcs.generate_client_certificate if parent_rpcs.respond_to? :generate_client_certificate - @generate_client_certificate = ::Gapic::Config::Method.new generate_client_certificate_config - get_connection_info_config = parent_rpcs.get_connection_info if parent_rpcs.respond_to? :get_connection_info - @get_connection_info = ::Gapic::Config::Method.new get_connection_info_config - list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users - @list_users = ::Gapic::Config::Method.new list_users_config - get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user - @get_user = ::Gapic::Config::Method.new get_user_config - create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user - @create_user = ::Gapic::Config::Method.new create_user_config - update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user - @update_user = ::Gapic::Config::Method.new update_user_config - delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user - @delete_user = ::Gapic::Config::Method.new delete_user_config - 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 - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb deleted file mode 100644 index f238b11dc00d..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBAdmin - # Credentials for the AlloyDBAdmin 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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb deleted file mode 100644 index b8ec489b85c7..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBAdmin - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AlloyDBAdmin 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 AlloyDBAdmin 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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::AlloyDB::V1beta::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 = "alloydb.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb deleted file mode 100644 index 420dba730fe8..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/paths.rb +++ /dev/null @@ -1,231 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBAdmin - # Path helper methods for the AlloyDBAdmin API. - module Paths - ## - # Create a fully-qualified Backup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backups/{backup}` - # - # @param project [String] - # @param location [String] - # @param backup [String] - # - # @return [::String] - def backup_path project:, location:, backup: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backups/#{backup}" - end - - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified CryptoKeyVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified Database resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param database [String] - # - # @return [::String] - def database_path project:, location:, cluster:, database: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/databases/#{database}" - end - - ## - # Create a fully-qualified Instance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param instance [String] - # - # @return [::String] - def instance_path project:, location:, cluster:, instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/instances/#{instance}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/global/networks/{network}` - # - # @param project [String] - # @param network [String] - # - # @return [::String] - def network_path project:, network: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/global/networks/#{network}" - end - - ## - # Create a fully-qualified ServiceAttachment resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}` - # - # @param project [String] - # @param region [String] - # @param service_attachment [String] - # - # @return [::String] - def service_attachment_path project:, region:, service_attachment: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/serviceAttachments/#{service_attachment}" - end - - ## - # Create a fully-qualified User resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/users/{user}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param user [String] - # - # @return [::String] - def user_path project:, location:, cluster:, user: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/users/#{user}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb deleted file mode 100644 index be41474bfee0..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/alloy_db/v1beta/version" -require "google/cloud/alloy_db/v1beta/bindings_override" - -require "google/cloud/alloy_db/v1beta/alloy_db_admin/credentials" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/paths" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client" - -module Google - module Cloud - module AlloyDB - module V1beta - ## - # Service describing handlers for resources - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - module AlloyDBAdmin - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb deleted file mode 100644 index 210a4ce32653..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/client.rb +++ /dev/null @@ -1,4628 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/alloydb/v1beta/service_pb" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBAdmin - module Rest - ## - # REST client for the AlloyDBAdmin service. - # - # Service describing handlers for resources - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :alloy_db_admin_stub - - ## - # Configure the AlloyDBAdmin Client class. - # - # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AlloyDBAdmin clients - # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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", "AlloyDB", "V1beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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_clusters.timeout = 60.0 - default_config.rpcs.list_clusters.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_cluster.timeout = 60.0 - default_config.rpcs.get_cluster.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_instances.timeout = 60.0 - default_config.rpcs.list_instances.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_instance.timeout = 60.0 - default_config.rpcs.get_instance.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_backups.timeout = 60.0 - default_config.rpcs.list_backups.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_backup.timeout = 60.0 - default_config.rpcs.get_backup.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_supported_database_flags.timeout = 60.0 - default_config.rpcs.list_supported_database_flags.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.generate_client_certificate.timeout = 60.0 - default_config.rpcs.generate_client_certificate.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_connection_info.timeout = 60.0 - default_config.rpcs.get_connection_info.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_users.timeout = 60.0 - default_config.rpcs.list_users.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_user.timeout = 60.0 - default_config.rpcs.get_user.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_databases.timeout = 60.0 - default_config.rpcs.list_databases.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_database.timeout = 60.0 - default_config.rpcs.create_database.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 AlloyDBAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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 - @alloy_db_admin_stub.universe_domain - end - - ## - # Create a new AlloyDBAdmin REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AlloyDBAdmin 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::AlloyDB::V1beta::AlloyDBAdmin::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 - - @alloy_db_admin_stub = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @alloy_db_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 - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @alloy_db_admin_stub.endpoint - config.universe_domain = @alloy_db_admin_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @alloy_db_admin_stub.endpoint - config.universe_domain = @alloy_db_admin_stub.universe_domain - config.logger = @alloy_db_admin_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @alloy_db_admin_stub.logger - end - - # Service calls - - ## - # Lists Clusters in a given project and location. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Cluster.name field. Additionally, you can perform an - # aggregated list operation by specifying a value with the following format: - # * projects/\\{project}/locations/- - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results - # @param order_by [::String] - # Optional. Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Cluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Cluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_clusters.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.list_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_clusters, "clusters", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets details of a single Cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_cluster(name: nil, view: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field. - # @param view [::Google::Cloud::AlloyDB::V1beta::ClusterView] - # Optional. The view of the cluster to return. Returns all default fields if - # not set. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.get_cluster request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new Cluster in a given project and location. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of the new cluster. For the required format, see the - # comment on the Cluster.name field. - # @param cluster_id [::String] - # Required. ID of the requesting object. - # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.create_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the parameters of a single Cluster. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Cluster 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 cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param allow_missing [::Boolean] - # Optional. If set to true, update succeeds even if cluster is not found. In - # that case, a new cluster is created and `update_mask` is ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.update_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Exports data from the cluster. - # Imperative only. - # - # @overload export_cluster(request, options = nil) - # Pass arguments to `export_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_cluster(gcs_destination: nil, csv_export_options: nil, sql_export_options: nil, name: nil, database: nil) - # Pass arguments to `export_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param gcs_destination [::Google::Cloud::AlloyDB::V1beta::GcsDestination, ::Hash] - # Required. Option to export data to cloud storage. - # @param csv_export_options [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::CsvExportOptions, ::Hash] - # Options for exporting data in CSV format. Required field to be set for - # CSV file type. - # - # Note: The following parameters are mutually exclusive: `csv_export_options`, `sql_export_options`. 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 sql_export_options [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::SqlExportOptions, ::Hash] - # Options for exporting data in SQL format. Required field to be set for - # SQL file type. - # - # Note: The following parameters are mutually exclusive: `sql_export_options`, `csv_export_options`. 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 name [::String] - # Required. The resource name of the cluster. - # @param database [::String] - # Required. Name of the database where the export command will be executed. - # Note - Value provided should be the same as expected from - # `SELECT current_database();` and NOT as a resource reference. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new - # - # # Call the export_cluster method. - # result = client.export_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def export_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.export_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.export_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Imports data to the cluster. - # Imperative only. - # - # @overload import_cluster(request, options = nil) - # Pass arguments to `import_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload import_cluster(sql_import_options: nil, csv_import_options: nil, name: nil, gcs_uri: nil, database: nil, user: nil) - # Pass arguments to `import_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param sql_import_options [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::SqlImportOptions, ::Hash] - # Options for importing data in SQL format. - # - # Note: The following parameters are mutually exclusive: `sql_import_options`, `csv_import_options`. 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 csv_import_options [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::CsvImportOptions, ::Hash] - # Options for importing data in CSV format. - # - # Note: The following parameters are mutually exclusive: `csv_import_options`, `sql_import_options`. 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 name [::String] - # Required. The resource name of the cluster. - # @param gcs_uri [::String] - # Required. The path to the file in Google Cloud Storage where the source - # file for import will be stored. The URI is in the form - # `gs://bucketName/fileName`. - # @param database [::String] - # Optional. Name of the database to which the import will be done. - # For import from SQL file, this is required only if the file does not - # specify a database. - # Note - Value provided should be the same as expected from `SELECT - # current_database();` and NOT as a resource reference. - # @param user [::String] - # Optional. Database user to be used for importing the data. - # Note - Value provided should be the same as expected from - # `SELECT current_user;` and NOT as a resource reference. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new - # - # # Call the import_cluster method. - # result = client.import_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def import_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.import_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.import_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.import_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Upgrades a single Cluster. - # Imperative only. - # - # @overload upgrade_cluster(request, options = nil) - # Pass arguments to `upgrade_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload upgrade_cluster(name: nil, version: nil, request_id: nil, validate_only: nil, etag: nil) - # Pass arguments to `upgrade_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the cluster. - # @param version [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] - # Required. The version the cluster is going to be upgraded to. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param etag [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # upgrade will be blocked and an ABORTED error will be returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new - # - # # Call the upgrade_cluster method. - # result = client.upgrade_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def upgrade_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.upgrade_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.upgrade_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.upgrade_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.upgrade_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a single Cluster. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil, force: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param etag [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # deletion will be blocked and an ABORTED error will be returned. - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param force [::Boolean] - # Optional. Whether to cascade delete child instances for given cluster. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.delete_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Promotes a SECONDARY cluster. This turns down replication - # from the PRIMARY cluster and promotes a secondary cluster - # into its own standalone cluster. - # Imperative only. - # - # @overload promote_cluster(request, options = nil) - # Pass arguments to `promote_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil) - # Pass arguments to `promote_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param etag [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # deletion will be blocked and an ABORTED error will be returned. - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new - # - # # Call the promote_cluster method. - # result = client.promote_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def promote_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.promote_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.promote_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.promote_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Switches the roles of PRIMARY and SECONDARY clusters without any data loss. - # This promotes the SECONDARY cluster to PRIMARY and sets up the original - # PRIMARY cluster to replicate from this newly promoted cluster. - # - # @overload switchover_cluster(request, options = nil) - # Pass arguments to `switchover_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload switchover_cluster(name: nil, request_id: nil, validate_only: nil) - # Pass arguments to `switchover_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new - # - # # Call the switchover_cluster method. - # result = client.switchover_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def switchover_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.switchover_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.switchover_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.switchover_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.switchover_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new Cluster in a given project and location, with a volume - # restored from the provided source, either a backup ID or a point-in-time - # and a source cluster. - # - # @overload restore_cluster(request, options = nil) - # Pass arguments to `restore_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `restore_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param backup_source [::Google::Cloud::AlloyDB::V1beta::BackupSource, ::Hash] - # Backup source. - # - # Note: The following parameters are mutually exclusive: `backup_source`, `continuous_backup_source`. 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 continuous_backup_source [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupSource, ::Hash] - # ContinuousBackup source. Continuous backup needs to be enabled in the - # source cluster for this operation to succeed. - # - # Note: The following parameters are mutually exclusive: `continuous_backup_source`, `backup_source`. 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 parent [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Cluster.name field. - # @param cluster_id [::String] - # Required. ID of the requesting object. - # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new - # - # # Call the restore_cluster method. - # result = client.restore_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def restore_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest - - # Converts hash and nil to an 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_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.restore_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.restore_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a cluster of type SECONDARY in the given location using - # the primary cluster as the source. - # - # @overload create_secondary_cluster(request, options = nil) - # Pass arguments to `create_secondary_cluster` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The location of the new cluster. For the required - # format, see the comment on the Cluster.name field. - # @param cluster_id [::String] - # Required. ID of the requesting object (the secondary cluster). - # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash] - # Required. Configuration of the requesting object (the secondary cluster). - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new - # - # # Call the create_secondary_cluster method. - # result = client.create_secondary_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_secondary_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_secondary_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_secondary_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.create_secondary_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists Instances in a given project and location. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_instances` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Instance.name field. Additionally, you can perform an - # aggregated list operation by specifying a value with one of the following - # formats: - # * projects/\\{project}/locations/-/clusters/- - # * projects/\\{project}/locations/\\{region}/clusters/- - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results - # @param order_by [::String] - # Optional. Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Instance>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Instance>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_admin_stub.list_instances request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_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 - - ## - # Gets details of a single Instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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, view: 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 resource. For the required format, see the - # comment on the Instance.name field. - # @param view [::Google::Cloud::AlloyDB::V1beta::InstanceView] - # The view of the instance to return. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Instance] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_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 a new Instance in a given project and location. - # - # @overload create_instance(request, options = nil) - # Pass arguments to `create_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: 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 parent resource. For the required format, see the - # comment on the Instance.name field. - # @param instance_id [::String] - # Required. ID of the requesting object. - # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_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 - - ## - # Creates a new SECONDARY Instance in a given project and location. - # - # @overload create_secondary_instance(request, options = nil) - # Pass arguments to `create_secondary_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_secondary_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 parent resource. For the required format, see the - # comment on the Instance.name field. - # @param instance_id [::String] - # Required. ID of the requesting object. - # @param instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash] - # Required. The resource being created - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new - # - # # Call the create_secondary_instance method. - # result = client.create_secondary_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_secondary_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_secondary_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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_secondary_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.create_secondary_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 - - ## - # Creates new instances under the given project, location and cluster. - # There can be only one primary instance in a cluster. If the primary - # instance exists in the cluster as well as this request, then API will - # throw an error. - # The primary instance should exist before any read pool instance is - # created. If the primary instance is a part of the request payload, then - # the API will take care of creating instances in the correct order. - # This method is here to support Google-internal use cases, and is not meant - # for external customers to consume. Please do not start relying on it; its - # behavior is subject to change without notice. - # - # @overload batch_create_instances(request, options = nil) - # Pass arguments to `batch_create_instances` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, requests: nil, request_id: nil) - # Pass arguments to `batch_create_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 parent resource. - # @param requests [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests, ::Hash] - # Required. Resources 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new - # - # # Call the batch_create_instances method. - # result = client.batch_create_instances request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest - - # Converts hash and nil to an 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_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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.batch_create_instances request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 parameters of a single Instance. - # - # @overload update_instance(request, options = nil) - # Pass arguments to `update_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_instance(update_mask: nil, instance: nil, request_id: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Instance 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 instance [::Google::Cloud::AlloyDB::V1beta::Instance, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param allow_missing [::Boolean] - # Optional. If set to true, update succeeds even if instance is not found. In - # that case, a new instance is created and `update_mask` is ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_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 a single Instance. - # - # @overload delete_instance(request, options = nil) - # Pass arguments to `delete_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_instance(name: nil, request_id: nil, etag: nil, validate_only: 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 resource. For the required format, see the - # comment on the Instance.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param etag [::String] - # Optional. The current etag of the Instance. - # If an etag is provided and does not match the current etag of the Instance, - # deletion will be blocked and an ABORTED error will be returned. - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new - # - # # Call the delete_instance method. - # result = client.delete_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_admin_stub.delete_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Forces a Failover for a highly available instance. - # Failover promotes the HA standby instance as the new primary. - # Imperative only. - # - # @overload failover_instance(request, options = nil) - # Pass arguments to `failover_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload failover_instance(name: nil, request_id: nil, validate_only: nil) - # Pass arguments to `failover_instance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new - # - # # Call the failover_instance method. - # result = client.failover_instance request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def failover_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.failover_instance.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.failover_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.failover_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.failover_instance request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Injects fault in an instance. - # Imperative only. - # - # @overload inject_fault(request, options = nil) - # Pass arguments to `inject_fault` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil) - # Pass arguments to `inject_fault` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param fault_type [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest::FaultType] - # Required. The type of fault to be injected in an instance. - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new - # - # # Call the inject_fault method. - # result = client.inject_fault request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def inject_fault request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.inject_fault.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.inject_fault.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.inject_fault.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.inject_fault request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Restart an Instance in a cluster. - # Imperative only. - # - # @overload restart_instance(request, options = nil) - # Pass arguments to `restart_instance` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload restart_instance(name: nil, request_id: nil, validate_only: nil, node_ids: nil) - # Pass arguments to `restart_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 resource. For the required format, see the - # comment on the Instance.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @param node_ids [::Array<::String>] - # Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - # restart upon. Applicable only to read 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new - # - # # Call the restart_instance method. - # result = client.restart_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 restart_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.restart_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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.restart_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.restart_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.restart_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 - - ## - # Executes a SQL statement in a database inside an AlloyDB instance. - # - # @overload execute_sql(request, options = nil) - # Pass arguments to `execute_sql` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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(password: nil, instance: nil, database: nil, user: nil, sql_statement: nil, validate_only: 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 password [::String] - # Optional. The database native user’s password. - # @param instance [::String] - # Required. The instance where the SQL will be executed. For the required - # format, see the comment on the Instance.name field. - # @param database [::String] - # Required. Name of the database where the query will be executed. - # Note - Value provided should be the same as expected from `SELECT - # current_database();` and NOT as a resource reference. - # @param user [::String] - # Required. Database user to be used for executing the SQL. - # Note - Value provided should be the same as expected from - # `SELECT current_user;` and NOT as a resource reference. - # @param sql_statement [::String] - # Required. SQL statement to execute on database. Any valid statement is - # permitted, including DDL, DML, DQL statements. - # @param validate_only [::Boolean] - # Optional. If set, validates the sql statement by performing - # syntax and semantic validation and doesn't execute the query. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new - # - # # Call the execute_sql method. - # result = client.execute_sql request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse. - # 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::AlloyDB::V1beta::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 - call_metadata = @config.rpcs.execute_sql.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.execute_sql.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.execute_sql.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.execute_sql request, 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 Backups in a given project and location. - # - # @overload list_backups(request, options = nil) - # Pass arguments to `list_backups` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: 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. Parent value for ListBackupsRequest - # @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::AlloyDB::V1beta::Backup>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Backup>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_admin_stub.list_backups request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_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 - - ## - # Gets details of a single Backup. - # - # @overload get_backup(request, options = nil) - # Pass arguments to `get_backup` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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 resource - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Backup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetBackupRequest.new - # - # # Call the get_backup method. - # result = client.get_backup request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_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 - - ## - # Creates a new Backup in a given project and location. - # - # @overload create_backup(request, options = nil) - # Pass arguments to `create_backup` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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, request_id: nil, validate_only: 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. Value for parent. - # @param backup_id [::String] - # Required. ID of the requesting object. - # @param backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute 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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_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 - - ## - # Updates the parameters of a single Backup. - # - # @overload update_backup(request, options = nil) - # Pass arguments to `update_backup` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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(update_mask: nil, backup: nil, request_id: nil, validate_only: nil, allow_missing: 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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Backup 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 backup [::Google::Cloud::AlloyDB::V1beta::Backup, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @param allow_missing [::Boolean] - # Optional. If set to true, update succeeds even if instance is not found. In - # that case, a new backup is created and `update_mask` is ignored. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new - # - # # Call the update_backup method. - # result = client.update_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 update_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_admin_stub.update_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 - - ## - # Deletes a single Backup. - # - # @overload delete_backup(request, options = nil) - # Pass arguments to `delete_backup` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_backup(name: nil, request_id: nil, validate_only: nil, etag: 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 resource. For the required format, see the comment on - # the Backup.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @param etag [::String] - # Optional. The current etag of the Backup. - # If an etag is provided and does not match the current etag of the Backup, - # deletion will be blocked and an ABORTED error will be returned. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new - # - # # Call the delete_backup method. - # result = client.delete_backup request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_backup request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_admin_stub.delete_backup request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists SupportedDatabaseFlags for a given project and location. - # - # @overload list_supported_database_flags(request, options = nil) - # Pass arguments to `list_supported_database_flags` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_supported_database_flags(parent: nil, page_size: nil, page_token: nil, scope: nil) - # Pass arguments to `list_supported_database_flags` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. The required format is: - # * projects/\\{project}/locations/\\{location} - # - # Regardless of the parent specified here, as long it is contains a valid - # project and location, the service will return a static list of supported - # flags resources. Note that we do not yet support region-specific - # flags. - # @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 scope [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::Scope] - # Optional. The scope for which supported flags are requested. If not - # specified, default is DATABASE. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new - # - # # Call the list_supported_database_flags method. - # result = client.list_supported_database_flags request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag. - # p item - # end - # - def list_supported_database_flags request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_supported_database_flags.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_supported_database_flags.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_supported_database_flags.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.list_supported_database_flags request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, "supported_database_flags", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Generate a client certificate signed by a Cluster CA. - # The sole purpose of this endpoint is to support AlloyDB connectors and the - # Auth Proxy client. The endpoint's behavior is subject to change without - # notice, so do not rely on its behavior remaining constant. Future changes - # will not break AlloyDB connectors or the Auth Proxy client. - # - # @overload generate_client_certificate(request, options = nil) - # Pass arguments to `generate_client_certificate` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil, public_key: nil, use_metadata_exchange: nil) - # Pass arguments to `generate_client_certificate` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. The required format is: - # * projects/\\{project}/locations/\\{location}/clusters/\\{cluster} - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param pem_csr [::String] - # Optional. A pem-encoded X.509 certificate signing request (CSR). It is - # recommended to use public_key instead. - # @param cert_duration [::Google::Protobuf::Duration, ::Hash] - # Optional. An optional hint to the endpoint to generate the client - # certificate with the requested duration. The duration can be from 1 hour to - # 24 hours. The endpoint may or may not honor the hint. If the hint is left - # unspecified or is not honored, then the endpoint will pick an appropriate - # default duration. - # @param public_key [::String] - # Optional. The public key from the client. - # @param use_metadata_exchange [::Boolean] - # Optional. An optional hint to the endpoint to generate a client certificate - # that can be used by AlloyDB connectors to exchange additional metadata with - # the server after TLS handshake. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new - # - # # Call the generate_client_certificate method. - # result = client.generate_client_certificate request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse. - # p result - # - def generate_client_certificate request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest - - # Converts hash and nil to an 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_client_certificate.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_client_certificate.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_client_certificate.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.generate_client_certificate request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get instance metadata used for a connection. - # - # @overload get_connection_info(request, options = nil) - # Pass arguments to `get_connection_info` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_connection_info(parent: nil, request_id: nil) - # Pass arguments to `get_connection_info` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The name of the parent resource. The required format is: - # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance} - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate 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::AlloyDB::V1beta::ConnectionInfo] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new - # - # # Call the get_connection_info method. - # result = client.get_connection_info request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::ConnectionInfo. - # p result - # - def get_connection_info request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_connection_info.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_connection_info.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_connection_info.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.get_connection_info request, 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 Users in a given project and location. - # - # @overload list_users(request, options = nil) - # Pass arguments to `list_users` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListUsersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_users` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 ListUsersRequest - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. Filtering results - # @param order_by [::String] - # Optional. Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::User>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::User>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::ListUsersRequest.new - # - # # Call the list_users method. - # result = client.list_users request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::AlloyDB::V1beta::User. - # p item - # end - # - def list_users request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_users.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_users.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_users.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.list_users request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_admin_stub, :list_users, "users", request, result, options - 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 User. - # - # @overload get_user(request, options = nil) - # Pass arguments to `get_user` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::GetUserRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::GetUserRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_user(name: nil) - # Pass arguments to `get_user` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the User.name field. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::GetUserRequest.new - # - # # Call the get_user method. - # result = client.get_user request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - # p result - # - def get_user request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::GetUserRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_user.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_user.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_user.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.get_user request, 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 User in a given project, location, and cluster. - # - # @overload create_user(request, options = nil) - # Pass arguments to `create_user` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateUserRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_user` via keyword arguments. Note that at - # least one keyword argument is required. To specify 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 user_id [::String] - # Required. ID of the requesting object. - # @param user [::Google::Cloud::AlloyDB::V1beta::User, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new - # - # # Call the create_user method. - # result = client.create_user request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - # p result - # - def create_user request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_user.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_user.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_user.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.create_user request, 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 User. - # - # @overload update_user(request, options = nil) - # Pass arguments to `update_user` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_user` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # User 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 user [::Google::Cloud::AlloyDB::V1beta::User, ::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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @param allow_missing [::Boolean] - # Optional. Allow missing fields in the update mask. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new - # - # # Call the update_user method. - # result = client.update_user request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - # p result - # - def update_user request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_user.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_user.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_user.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.update_user request, 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 User. - # - # @overload delete_user(request, options = nil) - # Pass arguments to `delete_user` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_user(name: nil, request_id: nil, validate_only: nil) - # Pass arguments to `delete_user` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the resource. For the required format, see the - # comment on the User.name field. - # @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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @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/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new - # - # # Call the delete_user method. - # result = client.delete_user request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_user request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_user.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_user.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_user.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_admin_stub.delete_user request, 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 Databases in a given project and location. - # - # @overload list_databases(request, options = nil) - # Pass arguments to `list_databases` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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, filter: 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. Parent value for ListDatabasesRequest. - # @param page_size [::Integer] - # Optional. The maximum number of databases to return. The service may return - # fewer than this value. If unspecified, 2000 is the default page_size. The - # max value of page_size will be 4000, values above max will be coerced to - # max. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListDatabases` call. - # This should be provided to retrieve the subsequent page. - # This field is currently not supported, its value will be ignored if passed. - # @param filter [::String] - # Optional. Filtering results. - # This field is currently not supported, its value will be ignored if passed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Database>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AlloyDB::V1beta::Database>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_admin_stub.list_databases request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @alloy_db_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 Database in a given project, location, and cluster. - # - # @overload create_database(request, options = nil) - # Pass arguments to `create_database` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::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, database_id: nil, database: 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. Value for parent. - # @param database_id [::String] - # Required. ID of the requesting object. - # @param database [::Google::Cloud::AlloyDB::V1beta::Database, ::Hash] - # Required. The resource being created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Database] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Database] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new - # - # # Call the create_database method. - # result = client.create_database request - # - # # The returned object is of type Google::Cloud::AlloyDB::V1beta::Database. - # p result - # - def create_database request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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 - - @alloy_db_admin_stub.create_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 - - ## - # Configuration class for the AlloyDBAdmin REST API. - # - # This class represents the configuration for AlloyDBAdmin REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "alloydb.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 AlloyDBAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `export_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :export_cluster - ## - # RPC-specific configuration for `import_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :import_cluster - ## - # RPC-specific configuration for `upgrade_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :upgrade_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `promote_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :promote_cluster - ## - # RPC-specific configuration for `switchover_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :switchover_cluster - ## - # RPC-specific configuration for `restore_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_cluster - ## - # RPC-specific configuration for `create_secondary_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secondary_cluster - ## - # RPC-specific configuration for `list_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_instance - ## - # RPC-specific configuration for `create_secondary_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secondary_instance - ## - # RPC-specific configuration for `batch_create_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_instances - ## - # 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 `failover_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :failover_instance - ## - # RPC-specific configuration for `inject_fault` - # @return [::Gapic::Config::Method] - # - attr_reader :inject_fault - ## - # RPC-specific configuration for `restart_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :restart_instance - ## - # RPC-specific configuration for `execute_sql` - # @return [::Gapic::Config::Method] - # - attr_reader :execute_sql - ## - # RPC-specific configuration for `list_backups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_backups - ## - # RPC-specific configuration for `get_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :get_backup - ## - # RPC-specific configuration for `create_backup` - # @return [::Gapic::Config::Method] - # - attr_reader :create_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_supported_database_flags` - # @return [::Gapic::Config::Method] - # - attr_reader :list_supported_database_flags - ## - # RPC-specific configuration for `generate_client_certificate` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_client_certificate - ## - # RPC-specific configuration for `get_connection_info` - # @return [::Gapic::Config::Method] - # - attr_reader :get_connection_info - ## - # RPC-specific configuration for `list_users` - # @return [::Gapic::Config::Method] - # - attr_reader :list_users - ## - # RPC-specific configuration for `get_user` - # @return [::Gapic::Config::Method] - # - attr_reader :get_user - ## - # RPC-specific configuration for `create_user` - # @return [::Gapic::Config::Method] - # - attr_reader :create_user - ## - # RPC-specific configuration for `update_user` - # @return [::Gapic::Config::Method] - # - attr_reader :update_user - ## - # RPC-specific configuration for `delete_user` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_user - ## - # 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 - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - export_cluster_config = parent_rpcs.export_cluster if parent_rpcs.respond_to? :export_cluster - @export_cluster = ::Gapic::Config::Method.new export_cluster_config - import_cluster_config = parent_rpcs.import_cluster if parent_rpcs.respond_to? :import_cluster - @import_cluster = ::Gapic::Config::Method.new import_cluster_config - upgrade_cluster_config = parent_rpcs.upgrade_cluster if parent_rpcs.respond_to? :upgrade_cluster - @upgrade_cluster = ::Gapic::Config::Method.new upgrade_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster - @promote_cluster = ::Gapic::Config::Method.new promote_cluster_config - switchover_cluster_config = parent_rpcs.switchover_cluster if parent_rpcs.respond_to? :switchover_cluster - @switchover_cluster = ::Gapic::Config::Method.new switchover_cluster_config - restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster - @restore_cluster = ::Gapic::Config::Method.new restore_cluster_config - create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster - @create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance - @create_instance = ::Gapic::Config::Method.new create_instance_config - create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance - @create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config - batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances - @batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_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 - failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance - @failover_instance = ::Gapic::Config::Method.new failover_instance_config - inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault - @inject_fault = ::Gapic::Config::Method.new inject_fault_config - restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance - @restart_instance = ::Gapic::Config::Method.new restart_instance_config - execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql - @execute_sql = ::Gapic::Config::Method.new execute_sql_config - list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups - @list_backups = ::Gapic::Config::Method.new list_backups_config - get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup - @get_backup = ::Gapic::Config::Method.new get_backup_config - create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup - @create_backup = ::Gapic::Config::Method.new create_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_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags - @list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config - generate_client_certificate_config = parent_rpcs.generate_client_certificate if parent_rpcs.respond_to? :generate_client_certificate - @generate_client_certificate = ::Gapic::Config::Method.new generate_client_certificate_config - get_connection_info_config = parent_rpcs.get_connection_info if parent_rpcs.respond_to? :get_connection_info - @get_connection_info = ::Gapic::Config::Method.new get_connection_info_config - list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users - @list_users = ::Gapic::Config::Method.new list_users_config - get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user - @get_user = ::Gapic::Config::Method.new get_user_config - create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user - @create_user = ::Gapic::Config::Method.new create_user_config - update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user - @update_user = ::Gapic::Config::Method.new update_user_config - delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user - @delete_user = ::Gapic::Config::Method.new delete_user_config - 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 - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb deleted file mode 100644 index bacf81ac9028..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/operations.rb +++ /dev/null @@ -1,924 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBAdmin - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AlloyDBAdmin 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 AlloyDBAdmin 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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "alloydb.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb deleted file mode 100644 index 4acdf9507722..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_admin/rest/service_stub.rb +++ /dev/null @@ -1,2422 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/alloydb/v1beta/service_pb" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBAdmin - module Rest - ## - # REST service stub for the AlloyDBAdmin service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ListClustersResponse] - # A result object deserialized from the server's reply - def list_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::ListClustersResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] - # A result object deserialized from the server's reply - def get_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::Cluster.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the export_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def export_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "export_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the import_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def import_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "import_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the upgrade_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def upgrade_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "upgrade_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the promote_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def promote_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_promote_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "promote_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the switchover_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def switchover_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_switchover_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "switchover_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the restore_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_restore_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "restore_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_secondary_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_secondary_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_secondary_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_secondary_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_instances REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::ListInstancesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::ListInstancesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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 create_secondary_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_secondary_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_secondary_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_secondary_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 batch_create_instances REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_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: "batch_create_instances", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_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::AlloyDB::V1beta::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::AlloyDB::V1beta::DeleteInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the failover_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def failover_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_failover_instance_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "failover_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the inject_fault REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def inject_fault request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_inject_fault_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "inject_fault", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the restart_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def restart_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_restart_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: "restart_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 execute_sql REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse] - # A result object deserialized from the server's reply - def execute_sql request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_execute_sql_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "execute_sql", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse.decode_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::AlloyDB::V1beta::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::AlloyDB::V1beta::ListBackupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::ListBackupsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_backup REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Backup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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 create_backup REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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 update_backup REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # 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::Longrunning::Operation.decode_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::AlloyDB::V1beta::DeleteBackupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_backup request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_backup_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_backup", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_supported_database_flags REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse] - # A result object deserialized from the server's reply - def list_supported_database_flags request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_supported_database_flags_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_supported_database_flags", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse.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_client_certificate REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse] - # A result object deserialized from the server's reply - def generate_client_certificate request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_client_certificate_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "generate_client_certificate", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_connection_info REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ConnectionInfo] - # A result object deserialized from the server's reply - def get_connection_info request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_connection_info_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_connection_info", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::ConnectionInfo.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_users REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::ListUsersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::ListUsersResponse] - # A result object deserialized from the server's reply - def list_users request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_users_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_users", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::ListUsersResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_user REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetUserRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # A result object deserialized from the server's reply - def get_user request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_user_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_user", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::User.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_user REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # A result object deserialized from the server's reply - def create_user request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_user_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_user", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::User.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_user REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::AlloyDB::V1beta::User] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # A result object deserialized from the server's reply - def update_user request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_user_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_user", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::AlloyDB::V1beta::User.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_user REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_user request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_user_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_user", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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_databases REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::ListDatabasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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::Cloud::AlloyDB::V1beta::Database] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::AlloyDB::V1beta::Database] - # 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::Cloud::AlloyDB::V1beta::Database.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListClustersRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/clusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/clusters", - body: "cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{cluster.name}", - body: "cluster", - matches: [ - ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_import_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:import", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the upgrade_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_upgrade_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{name}:upgrade", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the promote_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_promote_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:promote", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the switchover_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_switchover_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:switchover", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the restore_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/clusters:restore", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_secondary_cluster REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_secondary_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/clusters:createsecondary", - body: "cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instances REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/instances", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/instances", - body: "instance", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_secondary_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_secondary_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/instances:createsecondary", - body: "instance", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_create_instances REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest] - # 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_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/instances:batchCreate", - body: "requests", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{instance.name}", - body: "instance", - matches: [ - ["instance.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the failover_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_failover_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:failover", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the inject_fault REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_inject_fault_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:injectFault", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the restart_instance REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_restart_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:restart", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the execute_sql REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_execute_sql_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{instance}:executeSql", - body: "*", - matches: [ - ["instance", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_backups REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/backups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_backup REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_backup REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/backups", - body: "backup", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_backup REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{backup.name}", - body: "backup", - matches: [ - ["backup.name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_backup REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/backups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_supported_database_flags REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_supported_database_flags_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/supportedDatabaseFlags", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_client_certificate REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest] - # 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_client_certificate_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}:generateClientCertificate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_connection_info REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_connection_info_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/connectionInfo", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_users REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::ListUsersRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_users_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/users", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_user REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::GetUserRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_user_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/users/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_user REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::CreateUserRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_user_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/users", - body: "user", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_user REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_user_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{user.name}", - body: "user", - matches: [ - ["user.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/users/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_user REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_user_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/users/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_databases REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/databases", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_database REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::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: "/v1beta/{parent}/databases", - body: "database", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin.rb deleted file mode 100644 index ac62193e3fa3..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/alloy_db/v1beta/version" - -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" - -module Google - module Cloud - module AlloyDB - module V1beta - ## - # Service for interactions with CloudSQL. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new - # - module AlloyDBCloudSQLAdmin - end - end - end - end -end - -helper_path = ::File.join __dir__, "alloy_db_cloud_sql_admin", "helpers.rb" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client.rb deleted file mode 100644 index 7346187f2baf..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/client.rb +++ /dev/null @@ -1,536 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/alloydb/v1beta/csql_service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBCloudSQLAdmin - ## - # Client for the AlloyDBCloudSQLAdmin service. - # - # Service for interactions with CloudSQL. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :alloy_db_cloud_sql_admin_stub - - ## - # Configure the AlloyDBCloudSQLAdmin Client class. - # - # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AlloyDBCloudSQLAdmin clients - # ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "AlloyDB", "V1beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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 AlloyDBCloudSQLAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @alloy_db_cloud_sql_admin_stub.universe_domain - end - - ## - # Create a new AlloyDBCloudSQLAdmin client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AlloyDBCloudSQLAdmin 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/alloydb/v1beta/csql_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 - - @alloy_db_cloud_sql_admin_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::AlloyDB::V1beta::AlloyDBCSQLAdmin::Stub, - credentials: credentials, - endpoint: @config.endpoint, - 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 - ) - - @alloy_db_cloud_sql_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 - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @alloy_db_cloud_sql_admin_stub.endpoint - config.universe_domain = @alloy_db_cloud_sql_admin_stub.universe_domain - config.logger = @alloy_db_cloud_sql_admin_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @alloy_db_cloud_sql_admin_stub.endpoint - config.universe_domain = @alloy_db_cloud_sql_admin_stub.universe_domain - config.logger = @alloy_db_cloud_sql_admin_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @alloy_db_cloud_sql_admin_stub.logger - end - - # Service calls - - ## - # Restores an AlloyDB cluster from a CloudSQL resource. - # - # @overload restore_from_cloud_sql(request, options = nil) - # Pass arguments to `restore_from_cloud_sql` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_from_cloud_sql(cloudsql_backup_run_source: nil, parent: nil, cluster_id: nil, cluster: nil) - # Pass arguments to `restore_from_cloud_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 cloudsql_backup_run_source [::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource, ::Hash] - # Cluster created from CloudSQL backup run. - # @param parent [::String] - # Required. The location of the new cluster. For the required format, see the - # comment on Cluster.name field. - # @param cluster_id [::String] - # Required. ID of the requesting object. - # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash] - # Required. The resource being created - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new - # - # # Call the restore_from_cloud_sql method. - # result = client.restore_from_cloud_sql request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_from_cloud_sql request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest - - # Converts hash and nil to 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_from_cloud_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_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_from_cloud_sql.timeout, - metadata: metadata, - retry_policy: @config.rpcs.restore_from_cloud_sql.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_cloud_sql_admin_stub.call_rpc :restore_from_cloud_sql, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, 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 AlloyDBCloudSQLAdmin API. - # - # This class represents the configuration for AlloyDBCloudSQLAdmin, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # restore_from_cloud_sql to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.restore_from_cloud_sql.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.restore_from_cloud_sql.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate 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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "alloydb.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the AlloyDBCloudSQLAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `restore_from_cloud_sql` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_from_cloud_sql - - # @private - def initialize parent_rpcs = nil - restore_from_cloud_sql_config = parent_rpcs.restore_from_cloud_sql if parent_rpcs.respond_to? :restore_from_cloud_sql - @restore_from_cloud_sql = ::Gapic::Config::Method.new restore_from_cloud_sql_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials.rb deleted file mode 100644 index cd77a84284ba..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBCloudSQLAdmin - # Credentials for the AlloyDBCloudSQLAdmin 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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations.rb deleted file mode 100644 index 4204bdb1646d..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/operations.rb +++ /dev/null @@ -1,841 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBCloudSQLAdmin - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AlloyDBCloudSQLAdmin 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 AlloyDBCloudSQLAdmin 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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_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::AlloyDB::V1beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_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::AlloyDB::V1beta::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 = "alloydb.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for 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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths.rb deleted file mode 100644 index d4657376e489..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths.rb +++ /dev/null @@ -1,149 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBCloudSQLAdmin - # Path helper methods for the AlloyDBCloudSQLAdmin API. - module Paths - ## - # Create a fully-qualified Backup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/backups/{backup}` - # - # @param project [String] - # @param location [String] - # @param backup [String] - # - # @return [::String] - def backup_path project:, location:, backup: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/backups/#{backup}" - end - - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified CryptoKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # - # @return [::String] - def crypto_key_path project:, location:, key_ring:, crypto_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" - end - - ## - # Create a fully-qualified CryptoKeyVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}` - # - # @param project [String] - # @param location [String] - # @param key_ring [String] - # @param crypto_key [String] - # @param crypto_key_version [String] - # - # @return [::String] - def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" - raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/" - - "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/global/networks/{network}` - # - # @param project [String] - # @param network [String] - # - # @return [::String] - def network_path project:, network: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/global/networks/#{network}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest.rb deleted file mode 100644 index 815a45f6c49b..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/alloy_db/v1beta/version" -require "google/cloud/alloy_db/v1beta/bindings_override" - -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/credentials" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/paths" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client" - -module Google - module Cloud - module AlloyDB - module V1beta - ## - # Service for interactions with CloudSQL. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new - # - module AlloyDBCloudSQLAdmin - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client.rb deleted file mode 100644 index f13328ef7d7a..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/client.rb +++ /dev/null @@ -1,494 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/alloydb/v1beta/csql_service_pb" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBCloudSQLAdmin - module Rest - ## - # REST client for the AlloyDBCloudSQLAdmin service. - # - # Service for interactions with CloudSQL. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :alloy_db_cloud_sql_admin_stub - - ## - # Configure the AlloyDBCloudSQLAdmin Client class. - # - # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AlloyDBCloudSQLAdmin clients - # ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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", "AlloyDB", "V1beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get 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 AlloyDBCloudSQLAdmin Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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 - @alloy_db_cloud_sql_admin_stub.universe_domain - end - - ## - # Create a new AlloyDBCloudSQLAdmin REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AlloyDBCloudSQLAdmin 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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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 - - @alloy_db_cloud_sql_admin_stub = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @alloy_db_cloud_sql_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 - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @alloy_db_cloud_sql_admin_stub.endpoint - config.universe_domain = @alloy_db_cloud_sql_admin_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @alloy_db_cloud_sql_admin_stub.logger if config.respond_to? :logger= - end - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @alloy_db_cloud_sql_admin_stub.endpoint - config.universe_domain = @alloy_db_cloud_sql_admin_stub.universe_domain - config.logger = @alloy_db_cloud_sql_admin_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @alloy_db_cloud_sql_admin_stub.logger - end - - # Service calls - - ## - # Restores an AlloyDB cluster from a CloudSQL resource. - # - # @overload restore_from_cloud_sql(request, options = nil) - # Pass arguments to `restore_from_cloud_sql` via a request object, either of type - # {::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_from_cloud_sql(cloudsql_backup_run_source: nil, parent: nil, cluster_id: nil, cluster: nil) - # Pass arguments to `restore_from_cloud_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 cloudsql_backup_run_source [::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource, ::Hash] - # Cluster created from CloudSQL backup run. - # @param parent [::String] - # Required. The location of the new cluster. For the required format, see the - # comment on Cluster.name field. - # @param cluster_id [::String] - # Required. ID of the requesting object. - # @param cluster [::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash] - # Required. The resource being created - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/alloy_db/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new - # - # # Call the restore_from_cloud_sql method. - # result = client.restore_from_cloud_sql request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how 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_from_cloud_sql request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest - - # Converts hash and nil to an 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_from_cloud_sql.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_from_cloud_sql.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.restore_from_cloud_sql.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @alloy_db_cloud_sql_admin_stub.restore_from_cloud_sql request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 AlloyDBCloudSQLAdmin REST API. - # - # This class represents the configuration for AlloyDBCloudSQLAdmin REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # restore_from_cloud_sql to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.restore_from_cloud_sql.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.restore_from_cloud_sql.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "alloydb.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::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 AlloyDBCloudSQLAdmin API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `restore_from_cloud_sql` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_from_cloud_sql - - # @private - def initialize parent_rpcs = nil - restore_from_cloud_sql_config = parent_rpcs.restore_from_cloud_sql if parent_rpcs.respond_to? :restore_from_cloud_sql - @restore_from_cloud_sql = ::Gapic::Config::Method.new restore_from_cloud_sql_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations.rb deleted file mode 100644 index 2419ff410cb1..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/operations.rb +++ /dev/null @@ -1,924 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBCloudSQLAdmin - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "alloydb.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AlloyDBCloudSQLAdmin 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 AlloyDBCloudSQLAdmin 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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION 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::AlloyDB::V1beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 = "alloydb.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub.rb deleted file mode 100644 index c20a7f148c39..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest/service_stub.rb +++ /dev/null @@ -1,143 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/alloydb/v1beta/csql_service_pb" - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBCloudSQLAdmin - module Rest - ## - # REST service stub for the AlloyDBCloudSQLAdmin 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 restore_from_cloud_sql REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @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_from_cloud_sql request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_restore_from_cloud_sql_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_from_cloud_sql", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - 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 restore_from_cloud_sql REST call - # - # @param request_pb [::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest] - # 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_from_cloud_sql_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/clusters:restoreFromCloudSQL", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/bindings_override.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/bindings_override.rb deleted file mode 100644 index 00d276bf4d70..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" - -module Google - module Cloud - module AlloyDB - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/alloy_db/v1beta/rest" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - module V1beta - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "AlloyDB"] - parent_config = while namespace.any? - parent_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: "/v1beta/{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: "/v1beta/{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-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/rest.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/rest.rb deleted file mode 100644 index 21641994a38a..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" -require "google/cloud/alloy_db/v1beta/bindings_override" -require "google/cloud/alloy_db/v1beta/version" - -module Google - module Cloud - module AlloyDB - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/alloy_db/v1beta/rest" - # client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new - # - module V1beta - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/version.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/version.rb deleted file mode 100644 index 1054128cc3b7..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloy_db/v1beta/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb deleted file mode 100644 index 9c0f11daadbb..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_resources_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/alloydb/v1beta/csql_resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n0google/cloud/alloydb/v1beta/csql_resources.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1fgoogle/api/field_behavior.proto\"`\n\x17\x43loudSQLBackupRunSource\x12\x0f\n\x07project\x18\x01 \x01(\t\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rbackup_run_id\x18\x03 \x01(\x03\x42\x03\xe0\x41\x02\x42\xcf\x01\n\x1f\x63om.google.cloud.alloydb.v1betaB\x12\x43sqlResourcesProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1betab\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module AlloyDB - module V1beta - CloudSQLBackupRunSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.CloudSQLBackupRunSource").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_pb.rb deleted file mode 100644 index 71936a56ae16..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/alloydb/v1beta/csql_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/alloydb/v1beta/csql_resources_pb' -require 'google/cloud/alloydb/v1beta/resources_pb' -require 'google/cloud/alloydb/v1beta/service_pb' -require 'google/longrunning/operations_pb' - - -descriptor_data = "\n.google/cloud/alloydb/v1beta/csql_service.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/alloydb/v1beta/csql_resources.proto\x1a+google/cloud/alloydb/v1beta/resources.proto\x1a)google/cloud/alloydb/v1beta/service.proto\x1a#google/longrunning/operations.proto\"\x8f\x02\n\x1aRestoreFromCloudSQLRequest\x12Z\n\x1a\x63loudsql_backup_run_source\x18\x65 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.CloudSQLBackupRunSourceH\x00\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x07\x63luster\x18\x03 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x42\x08\n\x06source2\xd3\x02\n\x10\x41lloyDBCSQLAdmin\x12\xf2\x01\n\x13RestoreFromCloudSQL\x12\x37.google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x11parent,cluster_id\x82\xd3\xe4\x93\x02I\"D/v1beta/{parent=projects/*/locations/*}/clusters:restoreFromCloudSQL:\x01*\x1aJ\xca\x41\x16\x61lloydb.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcd\x01\n\x1f\x63om.google.cloud.alloydb.v1betaB\x10\x43SQLServiceProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1betab\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.alloydb.v1beta.CloudSQLBackupRunSource", "google/cloud/alloydb/v1beta/csql_resources.proto"], - ["google.cloud.alloydb.v1beta.Cluster", "google/cloud/alloydb/v1beta/resources.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module AlloyDB - module V1beta - RestoreFromCloudSQLRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.RestoreFromCloudSQLRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_services_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_services_pb.rb deleted file mode 100644 index 1453fecf2503..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/csql_service_services_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/alloydb/v1beta/csql_service.proto for package 'Google.Cloud.AlloyDB.V1beta' -# 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/alloydb/v1beta/csql_service_pb' - -module Google - module Cloud - module AlloyDB - module V1beta - module AlloyDBCSQLAdmin - # Service for interactions with CloudSQL. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin' - - # Restores an AlloyDB cluster from a CloudSQL resource. - rpc :RestoreFromCloudSQL, ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/data_model_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/data_model_pb.rb deleted file mode 100644 index 71f4d415ec17..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/data_model_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/alloydb/v1beta/data_model.proto - -require 'google/protobuf' - - -descriptor_data = "\n,google/cloud/alloydb/v1beta/data_model.proto\x12\x1bgoogle.cloud.alloydb.v1beta\"\x83\x01\n\tSqlResult\x12=\n\x07\x63olumns\x18\x01 \x03(\x0b\x32,.google.cloud.alloydb.v1beta.SqlResultColumn\x12\x37\n\x04rows\x18\x02 \x03(\x0b\x32).google.cloud.alloydb.v1beta.SqlResultRow\"-\n\x0fSqlResultColumn\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\"K\n\x0cSqlResultRow\x12;\n\x06values\x18\x01 \x03(\x0b\x32+.google.cloud.alloydb.v1beta.SqlResultValue\"V\n\x0eSqlResultValue\x12\x12\n\x05value\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x17\n\nnull_value\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x08\n\x06_valueB\r\n\x0b_null_valueB\xcb\x01\n\x1f\x63om.google.cloud.alloydb.v1betaB\x0e\x44\x61taModelProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1betab\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module AlloyDB - module V1beta - SqlResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SqlResult").msgclass - SqlResultColumn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SqlResultColumn").msgclass - SqlResultRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SqlResultRow").msgclass - SqlResultValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SqlResultValue").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/gemini_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/gemini_pb.rb deleted file mode 100644 index 66efa930c5a0..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/gemini_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/alloydb/v1beta/gemini.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n(google/cloud/alloydb/v1beta/gemini.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1fgoogle/api/field_behavior.proto\".\n\x13GeminiClusterConfig\x12\x17\n\x08\x65ntitled\x18\x01 \x01(\x08\x42\x05\x18\x01\xe0\x41\x03\"/\n\x14GeminiInstanceConfig\x12\x17\n\x08\x65ntitled\x18\x01 \x01(\x08\x42\x05\x18\x01\xe0\x41\x03\"b\n\x11GCAInstanceConfig\x12M\n\x0fgca_entitlement\x18\x01 \x01(\x0e\x32/.google.cloud.alloydb.v1beta.GCAEntitlementTypeB\x03\xe0\x41\x03*L\n\x12GCAEntitlementType\x12$\n GCA_ENTITLEMENT_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGCA_STANDARD\x10\x01\x42\xc8\x01\n\x1f\x63om.google.cloud.alloydb.v1betaB\x0bGeminiProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1betab\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module AlloyDB - module V1beta - GeminiClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.GeminiClusterConfig").msgclass - GeminiInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.GeminiInstanceConfig").msgclass - GCAInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.GCAInstanceConfig").msgclass - GCAEntitlementType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.GCAEntitlementType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb deleted file mode 100644 index 7203024f9417..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/resources_pb.rb +++ /dev/null @@ -1,125 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/alloydb/v1beta/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/cloud/alloydb/v1beta/csql_resources_pb' -require 'google/cloud/alloydb/v1beta/gemini_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/type/date_pb' -require 'google/type/dayofweek_pb' -require 'google/type/timeofday_pb' - - -descriptor_data = "\n+google/cloud/alloydb/v1beta/resources.proto\x12\x1bgoogle.cloud.alloydb.v1beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/alloydb/v1beta/csql_resources.proto\x1a(google/cloud/alloydb/v1beta/gemini.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x16google/type/date.proto\x1a\x1bgoogle/type/dayofweek.proto\x1a\x1bgoogle/type/timeofday.proto\".\n\x0cUserPassword\x12\x0c\n\x04user\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\xe7\x01\n\x0fMigrationSource\x12\x16\n\thost_port\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0creference_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12Z\n\x0bsource_type\x18\x03 \x01(\x0e\x32@.google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceTypeB\x03\xe0\x41\x03\"E\n\x13MigrationSourceType\x12%\n!MIGRATION_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x44MS\x10\x01\"P\n\x10\x45ncryptionConfig\x12<\n\x0ckms_key_name\x18\x01 \x01(\tB&\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x8a\x02\n\x0e\x45ncryptionInfo\x12N\n\x0f\x65ncryption_type\x18\x01 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.EncryptionInfo.TypeB\x03\xe0\x41\x03\x12J\n\x10kms_key_versions\x18\x02 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\"\\\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\"\x86\x03\n\tSslConfig\x12\x45\n\x08ssl_mode\x18\x01 \x01(\x0e\x32..google.cloud.alloydb.v1beta.SslConfig.SslModeB\x03\xe0\x41\x01\x12G\n\tca_source\x18\x02 \x01(\x0e\x32/.google.cloud.alloydb.v1beta.SslConfig.CaSourceB\x03\xe0\x41\x01\"\xaa\x01\n\x07SslMode\x12\x18\n\x14SSL_MODE_UNSPECIFIED\x10\x00\x12\x16\n\x0eSSL_MODE_ALLOW\x10\x01\x1a\x02\x08\x01\x12\x18\n\x10SSL_MODE_REQUIRE\x10\x02\x1a\x02\x08\x01\x12\x1a\n\x12SSL_MODE_VERIFY_CA\x10\x03\x1a\x02\x08\x01\x12#\n\x1f\x41LLOW_UNENCRYPTED_AND_ENCRYPTED\x10\x04\x12\x12\n\x0e\x45NCRYPTED_ONLY\x10\x05\"<\n\x08\x43\x61Source\x12\x19\n\x15\x43\x41_SOURCE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43\x41_SOURCE_MANAGED\x10\x01\"\xf9\x06\n\x15\x41utomatedBackupPolicy\x12\\\n\x0fweekly_schedule\x18\x02 \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklyScheduleH\x00\x12\x65\n\x14time_based_retention\x18\x04 \x01(\x0b\x32\x45.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetentionH\x01\x12m\n\x18quantity_based_retention\x18\x05 \x01(\x0b\x32I.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetentionH\x01\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x02\x88\x01\x01\x12\x30\n\rbackup_window\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12M\n\x11\x65ncryption_config\x18\x08 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12\x10\n\x08location\x18\x06 \x01(\t\x12N\n\x06labels\x18\x07 \x03(\x0b\x32>.google.cloud.alloydb.v1beta.AutomatedBackupPolicy.LabelsEntry\x1ak\n\x0eWeeklySchedule\x12+\n\x0bstart_times\x18\x01 \x03(\x0b\x32\x16.google.type.TimeOfDay\x12,\n\x0c\x64\x61ys_of_week\x18\x02 \x03(\x0e\x32\x16.google.type.DayOfWeek\x1aI\n\x12TimeBasedRetention\x12\x33\n\x10retention_period\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\'\n\x16QuantityBasedRetention\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\n\n\x08scheduleB\x0b\n\tretentionB\n\n\x08_enabled\"\xa2\x01\n\x16\x43ontinuousBackupConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x14recovery_window_days\x18\x04 \x01(\x05\x12H\n\x11\x65ncryption_config\x18\x03 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\n\n\x08_enabled\"\x8a\x02\n\x14\x43ontinuousBackupInfo\x12I\n\x0f\x65ncryption_info\x18\x01 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12\x35\n\x0c\x65nabled_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12-\n\x08schedule\x18\x03 \x03(\x0e\x32\x16.google.type.DayOfWeekB\x03\xe0\x41\x03\x12\x41\n\x18\x65\x61rliest_restorable_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\x0c\x42\x61\x63kupSource\x12\x17\n\nbackup_uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12:\n\x0b\x62\x61\x63kup_name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61lloydb.googleapis.com/Backup\"f\n\x16\x43ontinuousBackupSource\x12\x14\n\x07\x63luster\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\rpoint_in_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\"\xde\x03\n\x17MaintenanceUpdatePolicy\x12\x63\n\x13maintenance_windows\x18\x01 \x03(\x0b\x32\x46.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow\x12l\n\x18\x64\x65ny_maintenance_periods\x18\x02 \x03(\x0b\x32J.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod\x1a\x64\n\x11MaintenanceWindow\x12#\n\x03\x64\x61y\x18\x01 \x01(\x0e\x32\x16.google.type.DayOfWeek\x12*\n\nstart_time\x18\x02 \x01(\x0b\x32\x16.google.type.TimeOfDay\x1a\x89\x01\n\x15\x44\x65nyMaintenancePeriod\x12%\n\nstart_date\x18\x01 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12$\n\x04time\x18\x03 \x01(\x0b\x32\x16.google.type.TimeOfDay\"J\n\x13MaintenanceSchedule\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xf6\x1a\n\x07\x43luster\x12G\n\rbackup_source\x18\x0f \x01(\x0b\x32).google.cloud.alloydb.v1beta.BackupSourceB\x03\xe0\x41\x03H\x00\x12M\n\x10migration_source\x18\x10 \x01(\x0b\x32,.google.cloud.alloydb.v1beta.MigrationSourceB\x03\xe0\x41\x03H\x00\x12_\n\x1a\x63loudsql_backup_run_source\x18* \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.CloudSQLBackupRunSourceB\x03\xe0\x41\x03H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12@\n\x06labels\x18\x07 \x03(\x0b\x32\x30.google.cloud.alloydb.v1beta.Cluster.LabelsEntry\x12>\n\x05state\x18\x08 \x01(\x0e\x32*.google.cloud.alloydb.v1beta.Cluster.StateB\x03\xe0\x41\x03\x12K\n\x0c\x63luster_type\x18\x18 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.Cluster.ClusterTypeB\x03\xe0\x41\x03\x12K\n\x10\x64\x61tabase_version\x18\t \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\x03\xe0\x41\x01\x12O\n\x0enetwork_config\x18\x1d \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.NetworkConfigB\x03\xe0\x41\x01\x12\x39\n\x07network\x18\n \x01(\tB(\x18\x01\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x0c\n\x04\x65tag\x18\x0b \x01(\t\x12J\n\x0b\x61nnotations\x18\x0c \x03(\x0b\x32\x35.google.cloud.alloydb.v1beta.Cluster.AnnotationsEntry\x12\x18\n\x0breconciling\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12\x44\n\x0cinitial_user\x18\x0e \x01(\x0b\x32).google.cloud.alloydb.v1beta.UserPasswordB\x03\xe0\x41\x04\x12S\n\x17\x61utomated_backup_policy\x18\x11 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.AutomatedBackupPolicy\x12>\n\nssl_config\x18\x12 \x01(\x0b\x32&.google.cloud.alloydb.v1beta.SslConfigB\x02\x18\x01\x12M\n\x11\x65ncryption_config\x18\x13 \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12I\n\x0f\x65ncryption_info\x18\x14 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12Z\n\x18\x63ontinuous_backup_config\x18\x1b \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.ContinuousBackupConfigB\x03\xe0\x41\x01\x12V\n\x16\x63ontinuous_backup_info\x18\x1c \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.ContinuousBackupInfoB\x03\xe0\x41\x03\x12N\n\x10secondary_config\x18\x16 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.Cluster.SecondaryConfig\x12O\n\x0eprimary_config\x18\x17 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.PrimaryConfigB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x1e \x01(\x08\x42\x03\xe0\x41\x03\x12G\n\npsc_config\x18\x1f \x01(\x0b\x32..google.cloud.alloydb.v1beta.Cluster.PscConfigB\x03\xe0\x41\x01\x12\\\n\x19maintenance_update_policy\x18 \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicyB\x03\xe0\x41\x01\x12S\n\x14maintenance_schedule\x18% \x01(\x0b\x32\x30.google.cloud.alloydb.v1beta.MaintenanceScheduleB\x03\xe0\x41\x03\x12N\n\rgemini_config\x18$ \x01(\x0b\x32\x30.google.cloud.alloydb.v1beta.GeminiClusterConfigB\x05\x18\x01\xe0\x41\x01\x12M\n\x11subscription_type\x18& \x01(\x0e\x32-.google.cloud.alloydb.v1beta.SubscriptionTypeB\x03\xe0\x41\x01\x12O\n\x0etrial_metadata\x18\' \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Cluster.TrialMetadataB\x03\xe0\x41\x03\x12G\n\x04tags\x18) \x03(\x0b\x32..google.cloud.alloydb.v1beta.Cluster.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x12\"\n\x15service_account_email\x18. \x01(\tB\x03\xe0\x41\x03\x1ai\n\rNetworkConfig\x12\x37\n\x07network\x18\x01 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12\x1f\n\x12\x61llocated_ip_range\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1aT\n\x0fSecondaryConfig\x12\x41\n\x14primary_cluster_name\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x1aX\n\rPrimaryConfig\x12G\n\x17secondary_cluster_names\x18\x01 \x03(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x1aP\n\tPscConfig\x12\x18\n\x0bpsc_enabled\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1cservice_owned_project_number\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x1a\xd3\x01\n\rTrialMetadata\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\x12\x30\n\x0cupgrade_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0egrace_end_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9c\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\t\n\x05\x45MPTY\x10\x03\x12\x0c\n\x08\x43REATING\x10\x04\x12\x0c\n\x08\x44\x45LETING\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x11\n\rBOOTSTRAPPING\x10\x07\x12\x0f\n\x0bMAINTENANCE\x10\x08\x12\r\n\tPROMOTING\x10\t\"G\n\x0b\x43lusterType\x12\x1c\n\x18\x43LUSTER_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02:u\xea\x41r\n\x1e\x61lloydb.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}*\x08\x63lusters2\x07\x63lusterR\x01\x01\x42\x08\n\x06source\"\xa2)\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x07 \x03(\x0b\x32\x31.google.cloud.alloydb.v1beta.Instance.LabelsEntry\x12?\n\x05state\x18\x08 \x01(\x0e\x32+.google.cloud.alloydb.v1beta.Instance.StateB\x03\xe0\x41\x03\x12N\n\rinstance_type\x18\t \x01(\x0e\x32\x32.google.cloud.alloydb.v1beta.Instance.InstanceTypeB\x03\xe0\x41\x02\x12K\n\x0emachine_config\x18\n \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.Instance.MachineConfig\x12Q\n\x11\x61vailability_type\x18\x0b \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.Instance.AvailabilityType\x12\x10\n\x08gce_zone\x18\x0c \x01(\t\x12P\n\x0e\x64\x61tabase_flags\x18\r \x03(\x0b\x32\x38.google.cloud.alloydb.v1beta.Instance.DatabaseFlagsEntry\x12\x46\n\rwritable_node\x18\x13 \x01(\x0b\x32*.google.cloud.alloydb.v1beta.Instance.NodeB\x03\xe0\x41\x03\x12>\n\x05nodes\x18\x14 \x03(\x0b\x32*.google.cloud.alloydb.v1beta.Instance.NodeB\x03\xe0\x41\x03\x12`\n\x15query_insights_config\x18\x15 \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig\x12_\n\x14observability_config\x18\x1a \x01(\x0b\x32\x41.google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig\x12N\n\x10read_pool_config\x18\x0e \x01(\x0b\x32\x34.google.cloud.alloydb.v1beta.Instance.ReadPoolConfig\x12\x17\n\nip_address\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12&\n\x11public_ip_address\x18\x1b \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x18\n\x0breconciling\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x11 \x01(\t\x12K\n\x0b\x61nnotations\x18\x12 \x03(\x0b\x32\x36.google.cloud.alloydb.v1beta.Instance.AnnotationsEntry\x12I\n\rupdate_policy\x18\x16 \x01(\x0b\x32\x32.google.cloud.alloydb.v1beta.Instance.UpdatePolicy\x12\x63\n\x18\x63lient_connection_config\x18\x17 \x01(\x0b\x32<.google.cloud.alloydb.v1beta.Instance.ClientConnectionConfigB\x03\xe0\x41\x01\x12\x1a\n\rsatisfies_pzs\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03\x12Y\n\x13psc_instance_config\x18\x1c \x01(\x0b\x32\x37.google.cloud.alloydb.v1beta.Instance.PscInstanceConfigB\x03\xe0\x41\x01\x12X\n\x0enetwork_config\x18\x1d \x01(\x0b\x32;.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfigB\x03\xe0\x41\x01\x12O\n\rgemini_config\x18! \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.GeminiInstanceConfigB\x05\x18\x01\xe0\x41\x01\x12\x31\n\x1coutbound_public_ip_addresses\x18\" \x03(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12V\n\x11\x61\x63tivation_policy\x18# \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.Instance.ActivationPolicyB\x03\xe0\x41\x01\x12_\n\x16\x63onnection_pool_config\x18% \x01(\x0b\x32:.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfigB\x03\xe0\x41\x01\x12G\n\ngca_config\x18& \x01(\x0b\x32..google.cloud.alloydb.v1beta.GCAInstanceConfigB\x03\xe0\x41\x03\x1a\x38\n\rMachineConfig\x12\x11\n\tcpu_count\x18\x01 \x01(\x05\x12\x14\n\x0cmachine_type\x18\x04 \x01(\t\x1aR\n\x04Node\x12\x14\n\x07zone_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x0f\n\x02ip\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05state\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a\xfa\x01\n\x1bQueryInsightsInstanceConfig\x12$\n\x17record_application_tags\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\"\n\x15record_client_address\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x1b\n\x13query_string_length\x18\x04 \x01(\r\x12#\n\x16query_plans_per_minute\x18\x05 \x01(\rH\x02\x88\x01\x01\x42\x1a\n\x18_record_application_tagsB\x18\n\x16_record_client_addressB\x19\n\x17_query_plans_per_minute\x1a\xfa\x04\n\x1bObservabilityInstanceConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1e\n\x11preserve_comments\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x1e\n\x11track_wait_events\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12(\n\x16track_wait_event_types\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03H\x03\x88\x01\x01\x12$\n\x17max_query_string_length\x18\x05 \x01(\x05H\x04\x88\x01\x01\x12$\n\x17record_application_tags\x18\x06 \x01(\x08H\x05\x88\x01\x01\x12#\n\x16query_plans_per_minute\x18\x07 \x01(\x05H\x06\x88\x01\x01\x12!\n\x14track_active_queries\x18\x08 \x01(\x08H\x07\x88\x01\x01\x12!\n\x14track_client_address\x18\t \x01(\x08H\x08\x88\x01\x01\x12*\n\x1d\x61ssistive_experiences_enabled\x18\n \x01(\x08H\t\x88\x01\x01\x42\n\n\x08_enabledB\x14\n\x12_preserve_commentsB\x14\n\x12_track_wait_eventsB\x19\n\x17_track_wait_event_typesB\x1a\n\x18_max_query_string_lengthB\x1a\n\x18_record_application_tagsB\x19\n\x17_query_plans_per_minuteB\x17\n\x15_track_active_queriesB\x17\n\x15_track_client_addressB \n\x1e_assistive_experiences_enabled\x1a$\n\x0eReadPoolConfig\x12\x12\n\nnode_count\x18\x01 \x01(\x05\x1a\x91\x01\n\x0cUpdatePolicy\x12\x45\n\x04mode\x18\x01 \x01(\x0e\x32\x37.google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode\":\n\x04Mode\x12\x14\n\x10MODE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x0f\n\x0b\x46ORCE_APPLY\x10\x02\x1az\n\x16\x43lientConnectionConfig\x12\x1f\n\x12require_connectors\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12?\n\nssl_config\x18\x02 \x01(\x0b\x32&.google.cloud.alloydb.v1beta.SslConfigB\x03\xe0\x41\x01\x1a\x39\n\x12PscInterfaceConfig\x12#\n\x1bnetwork_attachment_resource\x18\x01 \x01(\t\x1a\xa9\x01\n\x17PscAutoConnectionConfig\x12\x18\n\x10\x63onsumer_project\x18\x01 \x01(\t\x12\x18\n\x10\x63onsumer_network\x18\x02 \x01(\t\x12\x1f\n\nip_address\x18\x03 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12\x13\n\x06status\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12$\n\x17\x63onsumer_network_status\x18\x05 \x01(\tB\x03\xe0\x41\x03\x1a\xe9\x02\n\x11PscInstanceConfig\x12Q\n\x17service_attachment_link\x18\x01 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(compute.googleapis.com/ServiceAttachment\x12&\n\x19\x61llowed_consumer_projects\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cpsc_dns_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\\\n\x15psc_interface_configs\x18\x08 \x03(\x0b\x32\x38.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfigB\x03\xe0\x41\x01\x12`\n\x14psc_auto_connections\x18\t \x03(\x0b\x32=.google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfigB\x03\xe0\x41\x01\x1a\xee\x02\n\x15InstanceNetworkConfig\x12x\n\x1c\x61uthorized_external_networks\x18\x01 \x03(\x0b\x32M.google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetworkB\x03\xe0\x41\x01\x12\x1d\n\x10\x65nable_public_ip\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12&\n\x19\x65nable_outbound_public_ip\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x37\n\x07network\x18\x04 \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12(\n\x1b\x61llocated_ip_range_override\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x31\n\x11\x41uthorizedNetwork\x12\x1c\n\ncidr_range\x18\x01 \x01(\tB\x08\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x1a\xd0\x01\n\x14\x43onnectionPoolConfig\x12\x14\n\x07\x65nabled\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12Y\n\x05\x66lags\x18\r \x03(\x0b\x32\x45.google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig.FlagsEntryB\x03\xe0\x41\x01\x12\x19\n\x0cpooler_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x1a,\n\nFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x34\n\x12\x44\x61tabaseFlagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x91\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07STOPPED\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0f\n\x0bMAINTENANCE\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\x12\x11\n\rBOOTSTRAPPING\x10\x08\x12\r\n\tPROMOTING\x10\t\"X\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tREAD_POOL\x10\x02\x12\r\n\tSECONDARY\x10\x03\"N\n\x10\x41vailabilityType\x12!\n\x1d\x41VAILABILITY_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05ZONAL\x10\x01\x12\x0c\n\x08REGIONAL\x10\x02\"L\n\x10\x41\x63tivationPolicy\x12!\n\x1d\x41\x43TIVATION_POLICY_UNSPECIFIED\x10\x00\x12\n\n\x06\x41LWAYS\x10\x01\x12\t\n\x05NEVER\x10\x02:\x8e\x01\xea\x41\x8a\x01\n\x1f\x61lloydb.googleapis.com/Instance\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}*\tinstances2\x08instanceR\x01\x01\"\xea\x02\n\x0e\x43onnectionInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\nip_address\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12&\n\x11public_ip_address\x18\x05 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x02\x12$\n\x15pem_certificate_chain\x18\x03 \x03(\tB\x05\x18\x01\xe0\x41\x03\x12\x19\n\x0cinstance_uid\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cpsc_dns_name\x18\x06 \x01(\tB\x03\xe0\x41\x03:\xac\x01\xea\x41\xa8\x01\n%alloydb.googleapis.com/ConnectionInfo\x12^projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo*\x0f\x63onnectionInfos2\x0e\x63onnectionInfo\"\xa9\r\n\x06\x42\x61\x63kup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x0f \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x16\x63reate_completion_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x06 \x03(\x0b\x32/.google.cloud.alloydb.v1beta.Backup.LabelsEntry\x12=\n\x05state\x18\x07 \x01(\x0e\x32).google.cloud.alloydb.v1beta.Backup.StateB\x03\xe0\x41\x03\x12\x36\n\x04type\x18\x08 \x01(\x0e\x32(.google.cloud.alloydb.v1beta.Backup.Type\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12\x18\n\x0b\x63luster_uid\x18\x12 \x01(\tB\x03\xe0\x41\x03\x12<\n\x0c\x63luster_name\x18\n \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x18\n\x0breconciling\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03\x12M\n\x11\x65ncryption_config\x18\x0c \x01(\x0b\x32-.google.cloud.alloydb.v1beta.EncryptionConfigB\x03\xe0\x41\x01\x12I\n\x0f\x65ncryption_info\x18\r \x01(\x0b\x32+.google.cloud.alloydb.v1beta.EncryptionInfoB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\x0e \x01(\t\x12I\n\x0b\x61nnotations\x18\x10 \x03(\x0b\x32\x34.google.cloud.alloydb.v1beta.Backup.AnnotationsEntry\x12\x17\n\nsize_bytes\x18\x11 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpiry_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12U\n\x0f\x65xpiry_quantity\x18\x14 \x01(\x0b\x32\x37.google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiryB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x15 \x01(\x08\x42\x03\xe0\x41\x03\x12K\n\x10\x64\x61tabase_version\x18\x16 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\x03\xe0\x41\x03\x12\x46\n\x04tags\x18\x19 \x03(\x0b\x32-.google.cloud.alloydb.v1beta.Backup.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1aW\n\x13QuantityBasedExpiry\x12\x1c\n\x0fretention_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\"\n\x15total_retention_count\x18\x02 \x01(\x05\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\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"J\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tON_DEMAND\x10\x01\x12\r\n\tAUTOMATED\x10\x02\x12\x0e\n\nCONTINUOUS\x10\x03:p\xea\x41m\n\x1d\x61lloydb.googleapis.com/Backup\x12\x38projects/{project}/locations/{location}/backups/{backup}*\x07\x62\x61\x63kups2\x06\x62\x61\x63kupR\x01\x01\"\x90\t\n\x15SupportedDatabaseFlag\x12\x64\n\x13string_restrictions\x18\x07 \x01(\x0b\x32\x45.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictionsH\x00\x12\x66\n\x14integer_restrictions\x18\x08 \x01(\x0b\x32\x46.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictionsH\x00\x12\"\n\x18recommended_string_value\x18\n \x01(\tH\x01\x12@\n\x19recommended_integer_value\x18\x0b \x01(\x0b\x32\x1b.google.protobuf.Int64ValueH\x01\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tflag_name\x18\x02 \x01(\t\x12P\n\nvalue_type\x18\x03 \x01(\x0e\x32<.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType\x12\x1f\n\x17\x61\x63\x63\x65pts_multiple_values\x18\x04 \x01(\x08\x12K\n\x15supported_db_versions\x18\x05 \x03(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12\x1b\n\x13requires_db_restart\x18\x06 \x01(\x08\x12G\n\x05scope\x18\t \x01(\x0e\x32\x38.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope\x1a,\n\x12StringRestrictions\x12\x16\n\x0e\x61llowed_values\x18\x01 \x03(\t\x1au\n\x13IntegerRestrictions\x12.\n\tmin_value\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12.\n\tmax_value\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\"U\n\tValueType\x12\x1a\n\x16VALUE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\x0b\n\x07INTEGER\x10\x02\x12\t\n\x05\x46LOAT\x10\x03\x12\x08\n\x04NONE\x10\x04\"A\n\x05Scope\x12\x15\n\x11SCOPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44\x41TABASE\x10\x01\x12\x13\n\x0f\x43ONNECTION_POOL\x10\x02:\x97\x01\xea\x41\x93\x01\n,alloydb.googleapis.com/SupportedDatabaseFlag\x12\x34projects/{project}/locations/{location}/flags/{flag}*\x16supportedDatabaseFlags2\x15supportedDatabaseFlagB\x0e\n\x0crestrictionsB\x13\n\x11recommended_value\"\xfe\x02\n\x04User\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08password\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x1b\n\x0e\x64\x61tabase_roles\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x42\n\tuser_type\x18\x05 \x01(\x0e\x32*.google.cloud.alloydb.v1beta.User.UserTypeB\x03\xe0\x41\x01\x12\x1d\n\x10keep_extra_roles\x18\x06 \x01(\x08\x42\x03\xe0\x41\x04\"Q\n\x08UserType\x12\x19\n\x15USER_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41LLOYDB_BUILT_IN\x10\x01\x12\x14\n\x10\x41LLOYDB_IAM_USER\x10\x02:y\xea\x41v\n\x1b\x61lloydb.googleapis.com/User\x12Gprojects/{project}/locations/{location}/clusters/{cluster}/users/{user}*\x05users2\x04userR\x01\x01\"\x82\x03\n\x08\x44\x61tabase\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x17\n\x07\x63harset\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x19\n\tcollation\x18\x03 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1e\n\x0e\x63haracter_type\x18\x04 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x1a\n\x0bis_template\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12!\n\x11\x64\x61tabase_template\x18\x06 \x01(\tB\x06\xe0\x41\x04\xe0\x41\x05\x12&\n\x14is_template_database\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01:\x8e\x01\xea\x41\x8a\x01\n\x1f\x61lloydb.googleapis.com/Database\x12Oprojects/{project}/locations/{location}/clusters/{cluster}/databases/{database}*\tdatabases2\x08\x64\x61tabaseR\x01\x01\x42\x17\n\x15_is_template_database*^\n\x0cInstanceView\x12\x1d\n\x19INSTANCE_VIEW_UNSPECIFIED\x10\x00\x12\x17\n\x13INSTANCE_VIEW_BASIC\x10\x01\x12\x16\n\x12INSTANCE_VIEW_FULL\x10\x02*g\n\x0b\x43lusterView\x12\x1c\n\x18\x43LUSTER_VIEW_UNSPECIFIED\x10\x00\x12\x16\n\x12\x43LUSTER_VIEW_BASIC\x10\x01\x12\"\n\x1e\x43LUSTER_VIEW_CONTINUOUS_BACKUP\x10\x02*\x9d\x01\n\x0f\x44\x61tabaseVersion\x12 \n\x1c\x44\x41TABASE_VERSION_UNSPECIFIED\x10\x00\x12\x13\n\x0bPOSTGRES_13\x10\x01\x1a\x02\x08\x01\x12\x0f\n\x0bPOSTGRES_14\x10\x02\x12\x0f\n\x0bPOSTGRES_15\x10\x03\x12\x0f\n\x0bPOSTGRES_16\x10\x04\x12\x0f\n\x0bPOSTGRES_17\x10\x05\x12\x0f\n\x0bPOSTGRES_18\x10\x06*N\n\x10SubscriptionType\x12!\n\x1dSUBSCRIPTION_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\t\n\x05TRIAL\x10\x02\x42\xbb\x05\n\x1f\x63om.google.cloud.alloydb.v1betaB\x0eResourcesProtoP\x01Z9cloud.google.com/go/alloydb/apiv1beta/alloydbpb;alloydbpb\xaa\x02\x1bGoogle.Cloud.AlloyDb.V1Beta\xca\x02\x1bGoogle\\Cloud\\AlloyDb\\V1beta\xea\x02\x1eGoogle::Cloud::AlloyDB::V1beta\xea\x41\xa6\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12zprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}\xea\x41x\n!cloudkms.googleapis.com/CryptoKey\x12Sprojects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}\xea\x41w\n(compute.googleapis.com/ServiceAttachment\x12Kprojects/{project}/regions/{region}/serviceAttachments/{service_attachment}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.type.TimeOfDay", "google/type/timeofday.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.type.Date", "google/type/date.proto"], - ["google.cloud.alloydb.v1beta.CloudSQLBackupRunSource", "google/cloud/alloydb/v1beta/csql_resources.proto"], - ["google.cloud.alloydb.v1beta.GeminiClusterConfig", "google/cloud/alloydb/v1beta/gemini.proto"], - ["google.protobuf.Int64Value", "google/protobuf/wrappers.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module AlloyDB - module V1beta - UserPassword = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.UserPassword").msgclass - MigrationSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MigrationSource").msgclass - MigrationSource::MigrationSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType").enummodule - EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.EncryptionConfig").msgclass - EncryptionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.EncryptionInfo").msgclass - EncryptionInfo::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.EncryptionInfo.Type").enummodule - SslConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SslConfig").msgclass - SslConfig::SslMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SslConfig.SslMode").enummodule - SslConfig::CaSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SslConfig.CaSource").enummodule - AutomatedBackupPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.AutomatedBackupPolicy").msgclass - AutomatedBackupPolicy::WeeklySchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.AutomatedBackupPolicy.WeeklySchedule").msgclass - AutomatedBackupPolicy::TimeBasedRetention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.AutomatedBackupPolicy.TimeBasedRetention").msgclass - AutomatedBackupPolicy::QuantityBasedRetention = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.AutomatedBackupPolicy.QuantityBasedRetention").msgclass - ContinuousBackupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ContinuousBackupConfig").msgclass - ContinuousBackupInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ContinuousBackupInfo").msgclass - BackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.BackupSource").msgclass - ContinuousBackupSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ContinuousBackupSource").msgclass - MaintenanceUpdatePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy").msgclass - MaintenanceUpdatePolicy::MaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.MaintenanceWindow").msgclass - MaintenanceUpdatePolicy::DenyMaintenancePeriod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.DenyMaintenancePeriod").msgclass - MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.MaintenanceSchedule").msgclass - Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster").msgclass - Cluster::NetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.NetworkConfig").msgclass - Cluster::SecondaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.SecondaryConfig").msgclass - Cluster::PrimaryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.PrimaryConfig").msgclass - Cluster::PscConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.PscConfig").msgclass - Cluster::TrialMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.TrialMetadata").msgclass - Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.State").enummodule - Cluster::ClusterType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Cluster.ClusterType").enummodule - Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance").msgclass - Instance::MachineConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.MachineConfig").msgclass - Instance::Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.Node").msgclass - Instance::QueryInsightsInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig").msgclass - Instance::ObservabilityInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ObservabilityInstanceConfig").msgclass - Instance::ReadPoolConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ReadPoolConfig").msgclass - Instance::UpdatePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.UpdatePolicy").msgclass - Instance::UpdatePolicy::Mode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.UpdatePolicy.Mode").enummodule - Instance::ClientConnectionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ClientConnectionConfig").msgclass - Instance::PscInterfaceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig").msgclass - Instance::PscAutoConnectionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.PscAutoConnectionConfig").msgclass - Instance::PscInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.PscInstanceConfig").msgclass - Instance::InstanceNetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig").msgclass - Instance::InstanceNetworkConfig::AuthorizedNetwork = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.InstanceNetworkConfig.AuthorizedNetwork").msgclass - Instance::ConnectionPoolConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ConnectionPoolConfig").msgclass - Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.State").enummodule - Instance::InstanceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.InstanceType").enummodule - Instance::AvailabilityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.AvailabilityType").enummodule - Instance::ActivationPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Instance.ActivationPolicy").enummodule - ConnectionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ConnectionInfo").msgclass - Backup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Backup").msgclass - Backup::QuantityBasedExpiry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Backup.QuantityBasedExpiry").msgclass - Backup::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Backup.State").enummodule - Backup::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Backup.Type").enummodule - SupportedDatabaseFlag = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag").msgclass - SupportedDatabaseFlag::StringRestrictions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag.StringRestrictions").msgclass - SupportedDatabaseFlag::IntegerRestrictions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag.IntegerRestrictions").msgclass - SupportedDatabaseFlag::ValueType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ValueType").enummodule - SupportedDatabaseFlag::Scope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SupportedDatabaseFlag.Scope").enummodule - User = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.User").msgclass - User::UserType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.User.UserType").enummodule - Database = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.Database").msgclass - InstanceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.InstanceView").enummodule - ClusterView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.ClusterView").enummodule - DatabaseVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.DatabaseVersion").enummodule - SubscriptionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.alloydb.v1beta.SubscriptionType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_pb.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_pb.rb deleted file mode 100644 index ddc512a8ddfe..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/lib/google/cloud/alloydb/v1beta/service_pb.rb +++ /dev/null @@ -1,136 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/alloydb/v1beta/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/cloud/alloydb/v1beta/data_model_pb' -require 'google/cloud/alloydb/v1beta/resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n)google/cloud/alloydb/v1beta/service.proto\x12\x1bgoogle.cloud.alloydb.v1beta\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/cloud/alloydb/v1beta/data_model.proto\x1a+google/cloud/alloydb/v1beta/resources.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa5\x01\n\x13ListClustersRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"|\n\x14ListClustersResponse\x12\x36\n\x08\x63lusters\x18\x01 \x03(\x0b\x32$.google.cloud.alloydb.v1beta.Cluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x86\x01\n\x11GetClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12;\n\x04view\x18\x02 \x01(\x0e\x32(.google.cloud.alloydb.v1beta.ClusterViewB\x03\xe0\x41\x01\"\xe1\x01\n\x1d\x43reateSecondaryClusterRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x07\x63luster\x18\x03 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"\xd8\x01\n\x14\x43reateClusterRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x07\x63luster\x18\x03 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xd9\x01\n\x14UpdateClusterRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12:\n\x07\x63luster\x18\x02 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\"\n\x0eGcsDestination\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x81\x06\n\x14\x45xportClusterRequest\x12K\n\x0fgcs_destination\x18\x02 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.GcsDestinationB\x03\xe0\x41\x02H\x00\x12`\n\x12\x63sv_export_options\x18\x04 \x01(\x0b\x32\x42.google.cloud.alloydb.v1beta.ExportClusterRequest.CsvExportOptionsH\x01\x12`\n\x12sql_export_options\x18\x05 \x01(\x0b\x32\x42.google.cloud.alloydb.v1beta.ExportClusterRequest.SqlExportOptionsH\x01\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x15\n\x08\x64\x61tabase\x18\x03 \x01(\tB\x03\xe0\x41\x02\x1a\x88\x01\n\x10\x43svExportOptions\x12\x19\n\x0cselect_query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x66ield_delimiter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fquote_character\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x65scape_character\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\xde\x01\n\x10SqlExportOptions\x12\x13\n\x06tables\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x0bschema_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12&\n\x14\x63lean_target_objects\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12)\n\x17if_exist_target_objects\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x0e\n\x0c_schema_onlyB\x17\n\x15_clean_target_objectsB\x1a\n\x18_if_exist_target_objectsB\r\n\x0b\x64\x65stinationB\x10\n\x0e\x65xport_options\"s\n\x15\x45xportClusterResponse\x12K\n\x0fgcs_destination\x18\x02 \x01(\x0b\x32+.google.cloud.alloydb.v1beta.GcsDestinationB\x03\xe0\x41\x02H\x00\x42\r\n\x0b\x64\x65stination\"\x90\x04\n\x14ImportClusterRequest\x12`\n\x12sql_import_options\x18\x04 \x01(\x0b\x32\x42.google.cloud.alloydb.v1beta.ImportClusterRequest.SqlImportOptionsH\x00\x12`\n\x12\x63sv_import_options\x18\x07 \x01(\x0b\x32\x42.google.cloud.alloydb.v1beta.ImportClusterRequest.CsvImportOptionsH\x00\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x14\n\x07gcs_uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08\x64\x61tabase\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04user\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\x12\n\x10SqlImportOptions\x1a\x97\x01\n\x10\x43svImportOptions\x12\x12\n\x05table\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x63olumns\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x66ield_delimiter\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fquote_character\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10\x65scape_character\x18\x05 \x01(\tB\x03\xe0\x41\x01\x42\x10\n\x0eimport_options\"6\n\x15ImportClusterResponse\x12\x1d\n\x10\x62ytes_downloaded\x18\x01 \x01(\x03\x42\x03\xe0\x41\x02\"\xe1\x01\n\x15UpgradeClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x42\n\x07version\x18\x02 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersionB\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\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x86\x0b\n\x16UpgradeClusterResponse\x12J\n\x06status\x18\x01 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x0f\n\x07message\x18\x02 \x01(\t\x12j\n\x17\x63luster_upgrade_details\x18\x03 \x03(\x0b\x32I.google.cloud.alloydb.v1beta.UpgradeClusterResponse.ClusterUpgradeDetails\x1a\xb3\x01\n\tStageInfo\x12H\n\x05stage\x18\x01 \x01(\x0e\x32\x39.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage\x12J\n\x06status\x18\x02 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x10\n\x08logs_url\x18\x03 \x01(\t\x1a\xc5\x01\n\x16InstanceUpgradeDetails\x12\x0c\n\x04name\x18\x01 \x01(\t\x12R\n\x0eupgrade_status\x18\x02 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12I\n\rinstance_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.alloydb.v1beta.Instance.InstanceType\x1a\xca\x03\n\x15\x43lusterUpgradeDetails\x12\x0c\n\x04name\x18\x01 \x01(\t\x12R\n\x0eupgrade_status\x18\x02 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x46\n\x0c\x63luster_type\x18\x03 \x01(\x0e\x32\x30.google.cloud.alloydb.v1beta.Cluster.ClusterType\x12\x46\n\x10\x64\x61tabase_version\x18\x04 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12Q\n\nstage_info\x18\x05 \x03(\x0b\x32=.google.cloud.alloydb.v1beta.UpgradeClusterResponse.StageInfo\x12l\n\x18instance_upgrade_details\x18\x06 \x03(\x0b\x32J.google.cloud.alloydb.v1beta.UpgradeClusterResponse.InstanceUpgradeDetails\"\x97\x01\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNOT_STARTED\x10\x04\x12\x0f\n\x0bIN_PROGRESS\x10\x05\x12\x0b\n\x07SUCCESS\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\x13\n\x0fPARTIAL_SUCCESS\x10\x03\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x06\x12\r\n\tCANCELLED\x10\x07\"\xbd\x01\n\x05Stage\x12\x15\n\x11STAGE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41LLOYDB_PRECHECK\x10\x01\x12\x14\n\x10PG_UPGRADE_CHECK\x10\x02\x12\x17\n\x13PREPARE_FOR_UPGRADE\x10\x05\x12\x1c\n\x18PRIMARY_INSTANCE_UPGRADE\x10\x03\x12\x1f\n\x1bREAD_POOL_INSTANCES_UPGRADE\x10\x04\x12\x0c\n\x08ROLLBACK\x10\x06\x12\x0b\n\x07\x43LEANUP\x10\x07\"\xa8\x01\n\x14\x44\x65leteClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\x85\x01\n\x18SwitchoverClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x95\x01\n\x15PromoteClusterRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x80\x03\n\x15RestoreClusterRequest\x12\x42\n\rbackup_source\x18\x04 \x01(\x0b\x32).google.cloud.alloydb.v1beta.BackupSourceH\x00\x12W\n\x18\x63ontinuous_backup_source\x18\x08 \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.ContinuousBackupSourceH\x00\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x07\x63luster\x18\x03 \x01(\x0b\x32$.google.cloud.alloydb.v1beta.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x42\x08\n\x06source\"\xa7\x01\n\x14ListInstancesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Instance\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x7f\n\x15ListInstancesResponse\x12\x38\n\tinstances\x18\x01 \x03(\x0b\x32%.google.cloud.alloydb.v1beta.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x84\x01\n\x12GetInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x37\n\x04view\x18\x02 \x01(\x0e\x32).google.cloud.alloydb.v1beta.InstanceView\"\xdd\x01\n\x15\x43reateInstanceRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Instance\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08instance\x18\x03 \x01(\x0b\x32%.google.cloud.alloydb.v1beta.InstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xe6\x01\n\x1e\x43reateSecondaryInstanceRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Instance\x12\x18\n\x0binstance_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08instance\x18\x03 \x01(\x0b\x32%.google.cloud.alloydb.v1beta.InstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"s\n\x16\x43reateInstanceRequests\x12Y\n\x18\x63reate_instance_requests\x18\x01 \x03(\x0b\x32\x32.google.cloud.alloydb.v1beta.CreateInstanceRequestB\x03\xe0\x41\x02\"\xbb\x01\n\x1b\x42\x61tchCreateInstancesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Instance\x12J\n\x08requests\x18\x02 \x01(\x0b\x32\x33.google.cloud.alloydb.v1beta.CreateInstanceRequestsB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"X\n\x1c\x42\x61tchCreateInstancesResponse\x12\x38\n\tinstances\x18\x01 \x03(\x0b\x32%.google.cloud.alloydb.v1beta.Instance\"\x95\x02\n\x1c\x42\x61tchCreateInstancesMetadata\x12\x18\n\x10instance_targets\x18\x01 \x03(\t\x12j\n\x11instance_statuses\x18\x02 \x03(\x0b\x32O.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.InstanceStatusesEntry\x1ao\n\x15InstanceStatusesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x45\n\x05value\x18\x02 \x01(\x0b\x32\x36.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus:\x02\x38\x01\"\xd8\x02\n\x19\x42\x61tchCreateInstanceStatus\x12K\n\x05state\x18\x01 \x01(\x0e\x32<.google.cloud.alloydb.v1beta.BatchCreateInstanceStatus.State\x12\x11\n\terror_msg\x18\x02 \x01(\t\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\x12@\n\x04type\x18\x03 \x01(\x0e\x32\x32.google.cloud.alloydb.v1beta.Instance.InstanceType\"v\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0ePENDING_CREATE\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x0f\n\x0bROLLED_BACK\x10\x06\"\xdc\x01\n\x15UpdateInstanceRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12<\n\x08instance\x18\x02 \x01(\x0b\x32%.google.cloud.alloydb.v1beta.InstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\x96\x01\n\x15\x44\x65leteInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x85\x01\n\x17\x46\x61iloverInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x8a\x02\n\x12InjectFaultRequest\x12R\n\nfault_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.alloydb.v1beta.InjectFaultRequest.FaultTypeB\x03\xe0\x41\x02\x12\x35\n\x04name\x18\x02 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"4\n\tFaultType\x12\x1a\n\x16\x46\x41ULT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07STOP_VM\x10\x01\"\x9b\x01\n\x16RestartInstanceRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x15\n\x08node_ids\x18\x04 \x03(\tB\x03\xe0\x41\x01\"\xdc\x01\n\x11\x45xecuteSqlRequest\x12\x17\n\x08password\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x39\n\x08instance\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x15\n\x08\x64\x61tabase\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04user\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rsql_statement\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x42\x11\n\x0fuser_credential\"\x94\x01\n\x12\x45xecuteSqlResponse\x12;\n\x0bsql_results\x18\x01 \x03(\x0b\x32&.google.cloud.alloydb.v1beta.SqlResult\x12\x41\n\x08metadata\x18\x03 \x01(\x0b\x32/.google.cloud.alloydb.v1beta.ExecuteSqlMetadata\"\x8c\x02\n\x12\x45xecuteSqlMetadata\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x16\n\x0epartial_result\x18\x02 \x01(\x08\x12\x43\n sql_statement_execution_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x46\n\x06status\x18\x04 \x01(\x0e\x32\x36.google.cloud.alloydb.v1beta.ExecuteSqlMetadata.Status\"@\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x01\x12\x0b\n\x07PARTIAL\x10\x02\x12\t\n\x05\x45RROR\x10\x03\"\x94\x01\n\x12ListBackupsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x61lloydb.googleapis.com/Backup\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\"y\n\x13ListBackupsResponse\x12\x34\n\x07\x62\x61\x63kups\x18\x01 \x03(\x0b\x32#.google.cloud.alloydb.v1beta.Backup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"G\n\x10GetBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61lloydb.googleapis.com/Backup\"\xd3\x01\n\x13\x43reateBackupRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x61lloydb.googleapis.com/Backup\x12\x16\n\tbackup_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x06\x62\x61\x63kup\x18\x03 \x01(\x0b\x32#.google.cloud.alloydb.v1beta.BackupB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xd6\x01\n\x13UpdateBackupRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x38\n\x06\x62\x61\x63kup\x18\x02 \x01(\x0b\x32#.google.cloud.alloydb.v1beta.BackupB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\x92\x01\n\x13\x44\x65leteBackupRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x61lloydb.googleapis.com/Backup\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xde\x01\n!ListSupportedDatabaseFlagsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,alloydb.googleapis.com/SupportedDatabaseFlag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12L\n\x05scope\x18\x06 \x01(\x0e\x32\x38.google.cloud.alloydb.v1beta.SupportedDatabaseFlag.ScopeB\x03\xe0\x41\x01\"\x93\x01\n\"ListSupportedDatabaseFlagsResponse\x12T\n\x18supported_database_flags\x18\x01 \x03(\x0b\x32\x32.google.cloud.alloydb.v1beta.SupportedDatabaseFlag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xff\x01\n GenerateClientCertificateRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x61lloydb.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\x07pem_csr\x18\x03 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x35\n\rcert_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x17\n\npublic_key\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15use_metadata_exchange\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"}\n!GenerateClientCertificateResponse\x12\x1e\n\x0fpem_certificate\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x03\x12\"\n\x15pem_certificate_chain\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12\x14\n\x07\x63\x61_cert\x18\x03 \x01(\tB\x03\xe0\x41\x01\"l\n\x18GetConnectionInfoRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x61lloydb.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb3\x04\n\x11OperationMetadata\x12i\n\x1f\x62\x61tch_create_instances_metadata\x18\x08 \x01(\x0b\x32\x39.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadataB\x03\xe0\x41\x03H\x00\x12X\n\x16promote_cluster_status\x18\t \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.PromoteClusterStatusB\x03\xe0\x41\x03H\x00\x12X\n\x16upgrade_cluster_status\x18\n \x01(\x0b\x32\x31.google.cloud.alloydb.v1beta.UpgradeClusterStatusB\x03\xe0\x41\x03H\x00\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x42\x12\n\x10request_specific\"\xf4\x01\n\x14PromoteClusterStatus\x12K\n\x05state\x18\x01 \x01(\x0e\x32\x37.google.cloud.alloydb.v1beta.PromoteClusterStatus.StateB\x03\xe0\x41\x03\"\x8e\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12&\n\"PROMOTE_CLUSTER_AVAILABLE_FOR_READ\x10\x01\x12\'\n#PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE\x10\x02\x12\x1d\n\x19PROMOTE_CLUSTER_COMPLETED\x10\x03\"\xcd\t\n\x14UpgradeClusterStatus\x12I\n\x05state\x18\x01 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x13\n\x0b\x63\x61ncellable\x18\x02 \x01(\x08\x12\x44\n\x0esource_version\x18\x03 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12\x44\n\x0etarget_version\x18\x04 \x01(\x0e\x32,.google.cloud.alloydb.v1beta.DatabaseVersion\x12M\n\x06stages\x18\x05 \x03(\x0b\x32=.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus\x1a\x8d\x05\n\x0bStageStatus\x12|\n\x1bread_pool_instances_upgrade\x18\x0b \x01(\x0b\x32U.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatusH\x00\x12H\n\x05stage\x18\x01 \x01(\x0e\x32\x39.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Stage\x12I\n\x05state\x18\x02 \x01(\x0e\x32:.google.cloud.alloydb.v1beta.UpgradeClusterResponse.Status\x12\x62\n\x08schedule\x18\x03 \x01(\x0b\x32K.google.cloud.alloydb.v1beta.UpgradeClusterStatus.StageStatus.StageScheduleB\x03\xe0\x41\x03\x1a\xed\x01\n\rStageSchedule\x12\x38\n\x14\x65stimated_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x11\x61\x63tual_start_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\x12\x65stimated_end_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0f\x61\x63tual_end_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x17\n\x15stage_specific_status\x1a\xe9\x01\n#ReadPoolInstancesUpgradeStageStatus\x12r\n\rupgrade_stats\x18\x01 \x01(\x0b\x32[.google.cloud.alloydb.v1beta.UpgradeClusterStatus.ReadPoolInstancesUpgradeStageStatus.Stats\x1aN\n\x05Stats\x12\x13\n\x0bnot_started\x18\x01 \x01(\x05\x12\x0f\n\x07ongoing\x18\x02 \x01(\x05\x12\x0f\n\x07success\x18\x03 \x01(\x05\x12\x0e\n\x06\x66\x61iled\x18\x04 \x01(\x05\"\xa4\x01\n\x10ListUsersRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x61lloydb.googleapis.com/User\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\"s\n\x11ListUsersResponse\x12\x30\n\x05users\x18\x01 \x03(\x0b\x32!.google.cloud.alloydb.v1beta.User\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"C\n\x0eGetUserRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61lloydb.googleapis.com/User\"\xc9\x01\n\x11\x43reateUserRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x61lloydb.googleapis.com/User\x12\x14\n\x07user_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x04user\x18\x03 \x01(\x0b\x32!.google.cloud.alloydb.v1beta.UserB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xd0\x01\n\x11UpdateUserRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x34\n\x04user\x18\x02 \x01(\x0b\x32!.google.cloud.alloydb.v1beta.UserB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"{\n\x11\x44\x65leteUserRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x61lloydb.googleapis.com/User\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x95\x01\n\x14ListDatabasesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Database\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\"j\n\x15ListDatabasesResponse\x12\x38\n\tdatabases\x18\x01 \x03(\x0b\x32%.google.cloud.alloydb.v1beta.Database\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x15\x43reateDatabaseRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x61lloydb.googleapis.com/Database\x12\x18\n\x0b\x64\x61tabase_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x08\x64\x61tabase\x18\x03 \x01(\x0b\x32%.google.cloud.alloydb.v1beta.DatabaseB\x03\xe0\x41\x02\x32\x95\x41\n\x0c\x41lloyDBAdmin\x12\xb6\x01\n\x0cListClusters\x12\x30.google.cloud.alloydb.v1beta.ListClustersRequest\x1a\x31.google.cloud.alloydb.v1beta.ListClustersResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1beta/{parent=projects/*/locations/*}/clusters\x12\xa3\x01\n\nGetCluster\x12..google.cloud.alloydb.v1beta.GetClusterRequest\x1a$.google.cloud.alloydb.v1beta.Cluster\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1beta/{name=projects/*/locations/*/clusters/*}\x12\xdf\x01\n\rCreateCluster\x12\x31.google.cloud.alloydb.v1beta.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02;\"0/v1beta/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xe1\x01\n\rUpdateCluster\x12\x31.google.cloud.alloydb.v1beta.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02\x43\x32\x38/v1beta/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\x99\x02\n\rExportCluster\x12\x31.google.cloud.alloydb.v1beta.ExportClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb5\x01\xca\x41*\n\x15\x45xportClusterResponse\x12\x11OperationMetadata\xda\x41\x43name,gcs_destination,database,csv_export_options,sql_export_options\x82\xd3\xe4\x93\x02<\"7/v1beta/{name=projects/*/locations/*/clusters/*}:export:\x01*\x12\xf0\x01\n\rImportCluster\x12\x31.google.cloud.alloydb.v1beta.ImportClusterRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41*\n\x15ImportClusterResponse\x12\x11OperationMetadata\xda\x41\x1aname,gcs_uri,database,user\x82\xd3\xe4\x93\x02<\"7/v1beta/{name=projects/*/locations/*/clusters/*}:import:\x01*\x12\xe6\x01\n\x0eUpgradeCluster\x12\x32.google.cloud.alloydb.v1beta.UpgradeClusterRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41+\n\x16UpgradeClusterResponse\x12\x11OperationMetadata\xda\x41\x0cname,version\x82\xd3\xe4\x93\x02=28/v1beta/{name=projects/*/locations/*/clusters/*}:upgrade:\x01*\x12\xcf\x01\n\rDeleteCluster\x12\x31.google.cloud.alloydb.v1beta.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32*0/v1beta/{name=projects/*/locations/*/clusters/*}\x12\xce\x01\n\x0ePromoteCluster\x12\x32.google.cloud.alloydb.v1beta.PromoteClusterRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=\"8/v1beta/{name=projects/*/locations/*/clusters/*}:promote:\x01*\x12\xd7\x01\n\x11SwitchoverCluster\x12\x35.google.cloud.alloydb.v1beta.SwitchoverClusterRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02@\";/v1beta/{name=projects/*/locations/*/clusters/*}:switchover:\x01*\x12\xc7\x01\n\x0eRestoreCluster\x12\x32.google.cloud.alloydb.v1beta.RestoreClusterRequest\x1a\x1d.google.longrunning.Operation\"b\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02=\"8/v1beta/{parent=projects/*/locations/*}/clusters:restore:\x01*\x12\x82\x02\n\x16\x43reateSecondaryCluster\x12:.google.cloud.alloydb.v1beta.CreateSecondaryClusterRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02K\"@/v1beta/{parent=projects/*/locations/*}/clusters:createsecondary:\x07\x63luster\x12\xc5\x01\n\rListInstances\x12\x31.google.cloud.alloydb.v1beta.ListInstancesRequest\x1a\x32.google.cloud.alloydb.v1beta.ListInstancesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12*\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31\x12//v1beta/{name=projects/*/locations/*/backups/*}\x12\xd8\x01\n\x0c\x43reateBackup\x12\x30.google.cloud.alloydb.v1beta.CreateBackupRequest\x1a\x1d.google.longrunning.Operation\"w\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\xda\x41\x17parent,backup,backup_id\x82\xd3\xe4\x93\x02\x39\"//v1beta/{parent=projects/*/locations/*}/backups:\x06\x62\x61\x63kup\x12\xda\x01\n\x0cUpdateBackup\x12\x30.google.cloud.alloydb.v1beta.UpdateBackupRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1b\n\x06\x42\x61\x63kup\x12\x11OperationMetadata\xda\x41\x12\x62\x61\x63kup,update_mask\x82\xd3\xe4\x93\x02@26/v1beta/{backup.name=projects/*/locations/*/backups/*}:\x06\x62\x61\x63kup\x12\xcc\x01\n\x0c\x44\x65leteBackup\x12\x30.google.cloud.alloydb.v1beta.DeleteBackupRequest\x1a\x1d.google.longrunning.Operation\"k\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x31*//v1beta/{name=projects/*/locations/*/backups/*}\x12\xee\x01\n\x1aListSupportedDatabaseFlags\x12>.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsRequest\x1a?.google.cloud.alloydb.v1beta.ListSupportedDatabaseFlagsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1beta/{parent=projects/*/locations/*}/supportedDatabaseFlags\x12\xfc\x01\n\x19GenerateClientCertificate\x12=.google.cloud.alloydb.v1beta.GenerateClientCertificateRequest\x1a>.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse\"`\xda\x41\x06parent\x82\xd3\xe4\x93\x02Q\"L/v1beta/{parent=projects/*/locations/*/clusters/*}:generateClientCertificate:\x01*\x12\xd7\x01\n\x11GetConnectionInfo\x12\x35.google.cloud.alloydb.v1beta.GetConnectionInfoRequest\x1a+.google.cloud.alloydb.v1beta.ConnectionInfo\"^\xda\x41\x06parent\x82\xd3\xe4\x93\x02O\x12M/v1beta/{parent=projects/*/locations/*/clusters/*/instances/*}/connectionInfo\x12\xb5\x01\n\tListUsers\x12-.google.cloud.alloydb.v1beta.ListUsersRequest\x1a..google.cloud.alloydb.v1beta.ListUsersResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1beta/{parent=projects/*/locations/*/clusters/*}/users\x12\xa2\x01\n\x07GetUser\x12+.google.cloud.alloydb.v1beta.GetUserRequest\x1a!.google.cloud.alloydb.v1beta.User\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1beta/{name=projects/*/locations/*/clusters/*/users/*}\x12\xbd\x01\n\nCreateUser\x12..google.cloud.alloydb.v1beta.CreateUserRequest\x1a!.google.cloud.alloydb.v1beta.User\"\\\xda\x41\x13parent,user,user_id\x82\xd3\xe4\x93\x02@\"8/v1beta/{parent=projects/*/locations/*/clusters/*}/users:\x04user\x12\xbf\x01\n\nUpdateUser\x12..google.cloud.alloydb.v1beta.UpdateUserRequest\x1a!.google.cloud.alloydb.v1beta.User\"^\xda\x41\x10user,update_mask\x82\xd3\xe4\x93\x02\x45\x32=/v1beta/{user.name=projects/*/locations/*/clusters/*/users/*}:\x04user\x12\x9d\x01\n\nDeleteUser\x12..google.cloud.alloydb.v1beta.DeleteUserRequest\x1a\x16.google.protobuf.Empty\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1beta/{name=projects/*/locations/*/clusters/*/users/*}\x12\xc5\x01\n\rListDatabases\x12\x31.google.cloud.alloydb.v1beta.ListDatabasesRequest\x1a\x32.google.cloud.alloydb.v1beta.ListDatabasesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index fb9115c630af..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_info.rb deleted file mode 100644 index cea53f02d1a8..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index b836bdb60b21..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/resource.rb deleted file mode 100644 index 71b994c7ef20..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb deleted file mode 100644 index 02d71d45cc06..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_resources.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - # The source CloudSQL backup resource. - # @!attribute [rw] project - # @return [::String] - # The project ID of the source CloudSQL instance. This should be the same as - # the AlloyDB cluster's project. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The CloudSQL instance ID. - # @!attribute [rw] backup_run_id - # @return [::Integer] - # Required. The CloudSQL backup run ID. - class CloudSQLBackupRunSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_service.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_service.rb deleted file mode 100644 index 0ba7d0f8a16d..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/csql_service.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - # Message for registering Restoring from CloudSQL resource. - # @!attribute [rw] cloudsql_backup_run_source - # @return [::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource] - # Cluster created from CloudSQL backup run. - # @!attribute [rw] parent - # @return [::String] - # Required. The location of the new cluster. For the required format, see the - # comment on Cluster.name field. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. ID of the requesting object. - # @!attribute [rw] cluster - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] - # Required. The resource being created - class RestoreFromCloudSQLRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/data_model.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/data_model.rb deleted file mode 100644 index 0d34312057a2..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/data_model.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - # SqlResult represents the result for the execution of a sql statement. - # @!attribute [rw] columns - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SqlResultColumn>] - # List of columns included in the result. This also includes the data type - # of the column. - # @!attribute [rw] rows - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SqlResultRow>] - # Rows returned by the SQL statement. - class SqlResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains the name and datatype of a column in a SQL Result. - # @!attribute [rw] name - # @return [::String] - # Name of the column. - # @!attribute [rw] type - # @return [::String] - # Datatype of the column as reported by the postgres driver. - # Common type names are "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL", - # "INT", and "BIGINT". - class SqlResultColumn - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single row from a sql result. - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SqlResultValue>] - # List of values in a row of sql result. - class SqlResultRow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single value in a row from a sql result. - # @!attribute [rw] value - # @return [::String] - # The cell value represented in string format. - # Timestamps are converted to string using RFC3339Nano format. - # @!attribute [rw] null_value - # @return [::Boolean] - # Set to true if cell value is null. - class SqlResultValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/gemini.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/gemini.rb deleted file mode 100644 index 57f44b3de8b4..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/gemini.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - # Deprecated and unused. This message will be removed in the near future. - # @!attribute [r] entitled - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Output only. Deprecated and unused. This field will be removed in the near - # future. - class GeminiClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Deprecated and unused. This message will be removed in the near future. - # @!attribute [r] entitled - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Output only. Deprecated and unused. This field will be removed in the near - # future. - class GeminiInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Instance level configuration parameters related to the Gemini Cloud Assist - # product. - # @!attribute [r] gca_entitlement - # @return [::Google::Cloud::AlloyDB::V1beta::GCAEntitlementType] - # Output only. Represents the GCA entitlement state of the instance. - class GCAInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enum representing the type of GCA entitlement assigned to a resource. - module GCAEntitlementType - # No GCA entitlement is assigned. - GCA_ENTITLEMENT_TYPE_UNSPECIFIED = 0 - - # The resource is entitled to the GCA Standard Tier. - GCA_STANDARD = 1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb deleted file mode 100644 index a22e3fc7e742..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/resources.rb +++ /dev/null @@ -1,1801 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - # The username/password for a database user. Used for specifying initial - # users at cluster creation time. - # @!attribute [rw] user - # @return [::String] - # The database username. - # @!attribute [rw] password - # @return [::String] - # The initial password for the user. - class UserPassword - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Subset of the source instance configuration that is available when reading - # the cluster resource. - # @!attribute [r] host_port - # @return [::String] - # Output only. The host and port of the on-premises instance in host:port - # format - # @!attribute [r] reference_id - # @return [::String] - # Output only. Place holder for the external source identifier(e.g DMS job - # name) that created the cluster. - # @!attribute [r] source_type - # @return [::Google::Cloud::AlloyDB::V1beta::MigrationSource::MigrationSourceType] - # Output only. Type of migration source. - class MigrationSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Denote the type of migration source that created this cluster. - module MigrationSourceType - # Migration source is unknown. - MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0 - - # DMS source means the cluster was created via DMS migration job. - DMS = 1 - end - end - - # EncryptionConfig describes the encryption config of a cluster or a backup - # that is encrypted with a CMEK (customer-managed encryption key). - # @!attribute [rw] kms_key_name - # @return [::String] - # The fully-qualified resource name of the KMS key. - # Each Cloud KMS key is regionalized and has the following format: - # projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] - class EncryptionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # EncryptionInfo describes the encryption information of a cluster or a backup. - # @!attribute [r] encryption_type - # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionInfo::Type] - # Output only. Type of encryption. - # @!attribute [r] kms_key_versions - # @return [::Array<::String>] - # Output only. Cloud KMS key versions that are being used to protect the - # database or the backup. - class EncryptionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible encryption types. - module Type - # Encryption type not specified. Defaults to GOOGLE_DEFAULT_ENCRYPTION. - TYPE_UNSPECIFIED = 0 - - # The data is encrypted at rest with a key that is fully managed by Google. - # No key version will be populated. This is the default state. - GOOGLE_DEFAULT_ENCRYPTION = 1 - - # The data is encrypted at rest with a key that is managed by the customer. - # KMS key versions will be populated. - CUSTOMER_MANAGED_ENCRYPTION = 2 - end - end - - # SSL configuration. - # @!attribute [rw] ssl_mode - # @return [::Google::Cloud::AlloyDB::V1beta::SslConfig::SslMode] - # Optional. SSL mode. Specifies client-server SSL/TLS connection behavior. - # @!attribute [rw] ca_source - # @return [::Google::Cloud::AlloyDB::V1beta::SslConfig::CaSource] - # Optional. Certificate Authority (CA) source. Only CA_SOURCE_MANAGED is - # supported currently, and is the default value. - class SslConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # SSL mode options. - module SslMode - # SSL mode is not specified. Defaults to ENCRYPTED_ONLY. - SSL_MODE_UNSPECIFIED = 0 - - # SSL connections are optional. CA verification not enforced. - SSL_MODE_ALLOW = 1 - - # SSL connections are required. CA verification not enforced. - # Clients may use locally self-signed certificates (default psql client - # behavior). - SSL_MODE_REQUIRE = 2 - - # SSL connections are required. CA verification enforced. - # Clients must have certificates signed by a Cluster CA, for example, using - # GenerateClientCertificate. - SSL_MODE_VERIFY_CA = 3 - - # SSL connections are optional. CA verification not enforced. - ALLOW_UNENCRYPTED_AND_ENCRYPTED = 4 - - # SSL connections are required. CA verification not enforced. - ENCRYPTED_ONLY = 5 - end - - # Certificate Authority (CA) source for SSL/TLS certificates. - module CaSource - # Certificate Authority (CA) source not specified. Defaults to - # CA_SOURCE_MANAGED. - CA_SOURCE_UNSPECIFIED = 0 - - # Certificate Authority (CA) managed by the AlloyDB Cluster. - CA_SOURCE_MANAGED = 1 - end - end - - # Message describing the user-specified automated backup policy. - # - # All fields in the automated backup policy are optional. Defaults for each - # field are provided if they are not set. - # @!attribute [rw] weekly_schedule - # @return [::Google::Cloud::AlloyDB::V1beta::AutomatedBackupPolicy::WeeklySchedule] - # Weekly schedule for the Backup. - # @!attribute [rw] time_based_retention - # @return [::Google::Cloud::AlloyDB::V1beta::AutomatedBackupPolicy::TimeBasedRetention] - # Time-based Backup retention policy. - # - # Note: The following fields are mutually exclusive: `time_based_retention`, `quantity_based_retention`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] quantity_based_retention - # @return [::Google::Cloud::AlloyDB::V1beta::AutomatedBackupPolicy::QuantityBasedRetention] - # Quantity-based Backup retention policy to retain recent backups. - # - # Note: The following fields are mutually exclusive: `quantity_based_retention`, `time_based_retention`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] enabled - # @return [::Boolean] - # Whether automated automated backups are enabled. If not set, defaults to - # true. - # @!attribute [rw] backup_window - # @return [::Google::Protobuf::Duration] - # The length of the time window during which a backup can be - # taken. If a backup does not succeed within this time window, it will be - # canceled and considered failed. - # - # The backup window must be at least 5 minutes long. There is no upper bound - # on the window. If not set, it defaults to 1 hour. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionConfig] - # Optional. The encryption config can be specified to encrypt the - # backups with a customer-managed encryption key (CMEK). When this field is - # not specified, the backup will use the cluster's encryption config. - # @!attribute [rw] location - # @return [::String] - # The location where the backup will be stored. Currently, the only supported - # option is to store the backup in the same region as the cluster. - # - # If empty, defaults to the region of the cluster. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels to apply to backups created using this configuration. - class AutomatedBackupPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A weekly schedule starts a backup at prescribed start times within a - # day, for the specified days of the week. - # - # The weekly schedule message is flexible and can be used to create many - # types of schedules. For example, to have a daily backup that starts at - # 22:00, configure the `start_times` field to have one element "22:00" and - # the `days_of_week` field to have all seven days of the week. - # @!attribute [rw] start_times - # @return [::Array<::Google::Type::TimeOfDay>] - # The times during the day to start a backup. The start times are assumed - # to be in UTC and to be an exact hour (e.g., 04:00:00). - # - # If no start times are provided, a single fixed start time is chosen - # arbitrarily. - # @!attribute [rw] days_of_week - # @return [::Array<::Google::Type::DayOfWeek>] - # The days of the week to perform a backup. - # - # If this field is left empty, the default of every day of the week is - # used. - class WeeklySchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A time based retention policy specifies that all backups within a certain - # time period should be retained. - # @!attribute [rw] retention_period - # @return [::Google::Protobuf::Duration] - # The retention period. - class TimeBasedRetention - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A quantity based policy specifies that a certain number of the most recent - # successful backups should be retained. - # @!attribute [rw] count - # @return [::Integer] - # The number of backups to retain. - class QuantityBasedRetention - 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 - - # ContinuousBackupConfig describes the continuous backups recovery - # configurations of a cluster. - # @!attribute [rw] enabled - # @return [::Boolean] - # Whether ContinuousBackup is enabled. - # @!attribute [rw] recovery_window_days - # @return [::Integer] - # The number of days that are eligible to restore from using PITR. To support - # the entire recovery window, backups and logs are retained for one day more - # than the recovery window. If not set, defaults to 14 days. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionConfig] - # The encryption config can be specified to encrypt the - # backups with a customer-managed encryption key (CMEK). When this field is - # not specified, the backup will use the cluster's encryption config. - class ContinuousBackupConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ContinuousBackupInfo describes the continuous backup properties of a - # cluster. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionInfo] - # Output only. The encryption information for the WALs and backups required - # for ContinuousBackup. - # @!attribute [r] enabled_time - # @return [::Google::Protobuf::Timestamp] - # Output only. When ContinuousBackup was most recently enabled. Set to null - # if ContinuousBackup is not enabled. - # @!attribute [r] schedule - # @return [::Array<::Google::Type::DayOfWeek>] - # Output only. Days of the week on which a continuous backup is taken. - # @!attribute [r] earliest_restorable_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The earliest restorable time that can be restored to. If - # continuous backups and recovery was recently enabled, the earliest - # restorable time is the creation time of the earliest eligible backup within - # this cluster's continuous backup recovery window. After a cluster has had - # continuous backups enabled for the duration of its recovery window, the - # earliest restorable time becomes "now minus the recovery window". For - # example, assuming a point in time recovery is attempted at 04/16/2025 - # 3:23:00PM with a 14d recovery window, the earliest restorable time would be - # 04/02/2025 3:23:00PM. This field is only visible if the - # CLUSTER_VIEW_CONTINUOUS_BACKUP cluster view is provided. - class ContinuousBackupInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing a BackupSource. - # @!attribute [r] backup_uid - # @return [::String] - # Output only. The system-generated UID of the backup which was used to - # create this resource. The UID is generated when the backup is created, and - # it is retained until the backup is deleted. - # @!attribute [rw] backup_name - # @return [::String] - # Required. The name of the backup resource with the format: - # * projects/\\{project}/locations/\\{region}/backups/\\{backup_id} - class BackupSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing a ContinuousBackupSource. - # @!attribute [rw] cluster - # @return [::String] - # Required. The source cluster from which to restore. This cluster must have - # continuous backup enabled for this operation to succeed. For the required - # format, see the comment on the Cluster.name field. - # @!attribute [rw] point_in_time - # @return [::Google::Protobuf::Timestamp] - # Required. The point in time to restore to. - class ContinuousBackupSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # MaintenanceUpdatePolicy defines the policy for system updates. - # @!attribute [rw] maintenance_windows - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::MaintenanceUpdatePolicy::MaintenanceWindow>] - # Preferred windows to perform maintenance. Currently limited to 1. - # @!attribute [rw] deny_maintenance_periods - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::MaintenanceUpdatePolicy::DenyMaintenancePeriod>] - # Periods to deny maintenance. Currently limited to 1. - class MaintenanceUpdatePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # MaintenanceWindow specifies a preferred day and time for maintenance. - # @!attribute [rw] day - # @return [::Google::Type::DayOfWeek] - # Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. - # @!attribute [rw] start_time - # @return [::Google::Type::TimeOfDay] - # Preferred time to start the maintenance operation on the specified day. - # Maintenance will start within 1 hour of this time. - class MaintenanceWindow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DenyMaintenancePeriod definition. Excepting emergencies, maintenance - # will not be scheduled to start within this deny period. The start_date must - # be less than the end_date. - # @!attribute [rw] start_date - # @return [::Google::Type::Date] - # Deny period start date. - # This can be: - # * A full date, with non-zero year, month and day values OR - # * A month and day value, with a zero year for recurring - # @!attribute [rw] end_date - # @return [::Google::Type::Date] - # Deny period end date. - # This can be: - # * A full date, with non-zero year, month and day values OR - # * A month and day value, with a zero year for recurring - # @!attribute [rw] time - # @return [::Google::Type::TimeOfDay] - # Time in UTC when the deny period starts on start_date and ends on - # end_date. This can be: - # * Full time OR - # * All zeros for 00:00:00 UTC - class DenyMaintenancePeriod - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # MaintenanceSchedule stores the maintenance schedule generated from - # the MaintenanceUpdatePolicy, once a maintenance rollout is triggered, if - # MaintenanceWindow is set, and if there is no conflicting DenyPeriod. - # The schedule is cleared once the update takes place. This field cannot be - # manually changed; modify the MaintenanceUpdatePolicy instead. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The scheduled start time for the maintenance. - class MaintenanceSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A cluster is a collection of regional AlloyDB resources. It can include a - # primary instance and one or more read pool instances. - # All cluster resources share a storage layer, which scales as needed. - # @!attribute [r] backup_source - # @return [::Google::Cloud::AlloyDB::V1beta::BackupSource] - # Output only. Cluster created from backup. - # - # Note: The following fields are mutually exclusive: `backup_source`, `migration_source`, `cloudsql_backup_run_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] migration_source - # @return [::Google::Cloud::AlloyDB::V1beta::MigrationSource] - # Output only. Cluster created via DMS migration. - # - # Note: The following fields are mutually exclusive: `migration_source`, `backup_source`, `cloudsql_backup_run_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] cloudsql_backup_run_source - # @return [::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource] - # Output only. Cluster created from CloudSQL snapshot. - # - # Note: The following fields are mutually exclusive: `cloudsql_backup_run_source`, `backup_source`, `migration_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the cluster resource with the format: - # * projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id} - # where the cluster ID segment should satisfy the regex expression - # `[a-z0-9-]+`. For more details see https://google.aip.dev/122. - # The prefix of the cluster resource name is the name of the parent resource: - # * projects/\\{project}/locations/\\{region} - # @!attribute [rw] display_name - # @return [::String] - # User-settable and human-readable display name for the Cluster. - # @!attribute [r] uid - # @return [::String] - # Output only. The system-generated UID of the resource. The UID is assigned - # when the resource is created, and it is retained until it is deleted. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time stamp - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time stamp - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Delete time stamp - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [r] state - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::State] - # Output only. The current serving state of the cluster. - # @!attribute [r] cluster_type - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::ClusterType] - # Output only. The type of the cluster. This is an output-only field and it's - # populated at the Cluster creation time or the Cluster promotion - # time. The cluster type is determined by which RPC was used to create - # the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` - # @!attribute [rw] database_version - # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] - # Optional. The database engine major version. This is an optional field and - # it is populated at the Cluster creation time. If a database version is not - # supplied at cluster creation time, then a default database version will - # be used. - # @!attribute [rw] network_config - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::NetworkConfig] - # @!attribute [rw] network - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Required. The resource link for the VPC network in which cluster resources - # are created and from which they are accessible via Private IP. The network - # must belong to the same project as the cluster. It is specified in the - # form: `projects/{project}/global/networks/{network_id}`. This is required - # to create a cluster. Deprecated, use network_config.network instead. - # @!attribute [rw] etag - # @return [::String] - # For Resource freshness validation (https://google.aip.dev/154) - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Annotations to allow client tools to store small amount of arbitrary data. - # This is distinct from labels. - # https://google.aip.dev/128 - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Reconciling (https://google.aip.dev/128#reconciliation). - # Set to true if the current state of Cluster does not match the user's - # intended state, and the service is actively updating the resource to - # reconcile them. This can happen due to user-triggered updates or - # system actions like failover or maintenance. - # @!attribute [rw] initial_user - # @return [::Google::Cloud::AlloyDB::V1beta::UserPassword] - # Input only. Initial user to setup during cluster creation. Required. - # If used in `RestoreCluster` this is ignored. - # @!attribute [rw] automated_backup_policy - # @return [::Google::Cloud::AlloyDB::V1beta::AutomatedBackupPolicy] - # The automated backup policy for this cluster. - # - # If no policy is provided then the default policy will be used. If backups - # are supported for the cluster, the default policy takes one backup a day, - # has a backup window of 1 hour, and retains backups for 14 days. - # For more information on the defaults, consult the - # documentation for the message type. - # @!attribute [rw] ssl_config - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::AlloyDB::V1beta::SslConfig] - # SSL configuration for this AlloyDB cluster. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionConfig] - # Optional. The encryption config can be specified to encrypt the data disks - # and other persistent data resources of a cluster with a - # customer-managed encryption key (CMEK). When this field is not - # specified, the cluster will then use default encryption scheme to - # protect the user data. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionInfo] - # Output only. The encryption information for the cluster. - # @!attribute [rw] continuous_backup_config - # @return [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupConfig] - # Optional. Continuous backup configuration for this cluster. - # @!attribute [r] continuous_backup_info - # @return [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupInfo] - # Output only. Continuous backup properties for this cluster. - # @!attribute [rw] secondary_config - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::SecondaryConfig] - # Cross Region replication config specific to SECONDARY cluster. - # @!attribute [r] primary_config - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::PrimaryConfig] - # Output only. Cross Region replication config specific to PRIMARY cluster. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. Reserved for future use. - # @!attribute [rw] psc_config - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::PscConfig] - # Optional. The configuration for Private Service Connect (PSC) for the - # cluster. - # @!attribute [rw] maintenance_update_policy - # @return [::Google::Cloud::AlloyDB::V1beta::MaintenanceUpdatePolicy] - # Optional. The maintenance update policy determines when to allow or deny - # updates. - # @!attribute [r] maintenance_schedule - # @return [::Google::Cloud::AlloyDB::V1beta::MaintenanceSchedule] - # Output only. The maintenance schedule for the cluster, generated for a - # specific rollout if a maintenance window is set. - # @!attribute [rw] gemini_config - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::AlloyDB::V1beta::GeminiClusterConfig] - # Optional. Deprecated and unused. This field will be removed in the near - # future. - # @!attribute [rw] subscription_type - # @return [::Google::Cloud::AlloyDB::V1beta::SubscriptionType] - # Optional. Subscription type of the cluster. - # @!attribute [r] trial_metadata - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::TrialMetadata] - # Output only. Metadata for free trial clusters - # @!attribute [rw] tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Input only. Immutable. Tag keys/values directly bound to this - # resource. For example: - # ``` - # "123/environment": "production", - # "123/costCenter": "marketing" - # ``` - # @!attribute [r] service_account_email - # @return [::String] - # Output only. AlloyDB per-cluster service account. This service account is - # created per-cluster per-project, and is different from the per-project - # service account. The per-cluster service account naming format is subject - # to change. - class Cluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Metadata related to network configuration. - # @!attribute [rw] network - # @return [::String] - # Optional. The resource link for the VPC network in which cluster - # resources are created and from which they are accessible via Private IP. - # The network must belong to the same project as the cluster. It is - # specified in the form: - # `projects/{project_number}/global/networks/{network_id}`. This is - # required to create a cluster. - # @!attribute [rw] allocated_ip_range - # @return [::String] - # Optional. Name of the allocated IP range for the private IP AlloyDB - # cluster, for example: "google-managed-services-default". If set, the - # instance IPs for this cluster will be created in the allocated range. The - # range name must comply with RFC 1035. Specifically, the name must be 1-63 - # characters long and match the regular expression - # `[a-z]([-a-z0-9]*[a-z0-9])?`. - # Field name is intended to be consistent with Cloud SQL. - class NetworkConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration information for the secondary cluster. This should be set - # if and only if the cluster is of type SECONDARY. - # @!attribute [rw] primary_cluster_name - # @return [::String] - # The name of the primary cluster name with the format: - # * projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id} - class SecondaryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for the primary cluster. It has the list of clusters that are - # replicating from this cluster. This should be set if and only if the - # cluster is of type PRIMARY. - # @!attribute [r] secondary_cluster_names - # @return [::Array<::String>] - # Output only. Names of the clusters that are replicating from this - # cluster. - class PrimaryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PscConfig contains PSC related configuration at a cluster level. - # @!attribute [rw] psc_enabled - # @return [::Boolean] - # Optional. Create an instance that allows connections from Private Service - # Connect endpoints to the instance. - # @!attribute [r] service_owned_project_number - # @return [::Integer] - # Output only. The project number that needs to be allowlisted on the - # network attachment to enable outbound connectivity. - class PscConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains information and all metadata related to TRIAL clusters. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # start time of the trial cluster. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End time of the trial cluster. - # @!attribute [rw] upgrade_time - # @return [::Google::Protobuf::Timestamp] - # Upgrade time of trial cluster to Standard cluster. - # @!attribute [rw] grace_end_time - # @return [::Google::Protobuf::Timestamp] - # grace end time of the cluster. - class TrialMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cluster State - module State - # The state of the cluster is unknown. - STATE_UNSPECIFIED = 0 - - # The cluster is active and running. - READY = 1 - - # This is unused. Even when all instances in the cluster are stopped, the - # cluster remains in READY state. - STOPPED = 2 - - # The cluster is empty and has no associated resources. - # All instances, associated storage and backups have been deleted. - EMPTY = 3 - - # The cluster is being created. - CREATING = 4 - - # The cluster is being deleted. - DELETING = 5 - - # The creation of the cluster failed. - FAILED = 6 - - # The cluster is bootstrapping with data from some other source. - # Direct mutations to the cluster (e.g. adding read pool) are not allowed. - BOOTSTRAPPING = 7 - - # The cluster is under maintenance. AlloyDB regularly performs maintenance - # and upgrades on customer clusters. Updates on the cluster are - # not allowed while the cluster is in this state. - MAINTENANCE = 8 - - # The cluster is being promoted. - PROMOTING = 9 - end - - # Type of Cluster - module ClusterType - # The type of the cluster is unknown. - CLUSTER_TYPE_UNSPECIFIED = 0 - - # Primary cluster that support read and write operations. - PRIMARY = 1 - - # Secondary cluster that is replicating from another region. - # This only supports read. - SECONDARY = 2 - end - end - - # An Instance is a computing unit that an end customer can connect to. - # It's the main unit of computing resources in AlloyDB. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the instance resource with the format: - # * projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id}/instances/\\{instance_id} - # where the cluster and instance ID segments should satisfy the regex - # expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - # lowercase letters, numbers, and dashes, starting with a letter, and ending - # with a letter or number. For more details see https://google.aip.dev/122. - # The prefix of the instance resource name is the name of the parent - # resource: - # * projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id} - # @!attribute [rw] display_name - # @return [::String] - # User-settable and human-readable display name for the Instance. - # @!attribute [r] uid - # @return [::String] - # Output only. The system-generated UID of the resource. The UID is assigned - # when the resource is created, and it is retained until it is deleted. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time stamp - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time stamp - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Delete time stamp - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [r] state - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::State] - # Output only. The current serving state of the instance. - # @!attribute [rw] instance_type - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::InstanceType] - # Required. The type of the instance. Specified at creation time. - # @!attribute [rw] machine_config - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::MachineConfig] - # Configurations for the machines that host the underlying - # database engine. - # @!attribute [rw] availability_type - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::AvailabilityType] - # Availability type of an Instance. - # If empty, defaults to REGIONAL for primary instances. - # For read pools, availability_type is always UNSPECIFIED. Instances in the - # read pools are evenly distributed across available zones within the region - # (i.e. read pools with more than one node will have a node in at - # least two zones). - # @!attribute [rw] gce_zone - # @return [::String] - # The Compute Engine zone that the instance should serve from, per - # https://cloud.google.com/compute/docs/regions-zones - # This can ONLY be specified for ZONAL instances. - # If present for a REGIONAL instance, an error will be thrown. - # If this is absent for a ZONAL instance, instance is created in a random - # zone with available capacity. - # @!attribute [rw] database_flags - # @return [::Google::Protobuf::Map{::String => ::String}] - # Database flags. Set at the instance level. - # They are copied from the primary instance on secondary instance creation. - # Flags that have restrictions default to the value at primary - # instance on read instances during creation. Read instances can set new - # flags or override existing flags that are relevant for reads, for example, - # for enabling columnar cache on a read instance. Flags set on read instance - # might or might not be present on the primary instance. - # - # - # This is a list of "key": "value" pairs. - # "key": The name of the flag. These flags are passed at instance setup time, - # so include both server options and system variables for Postgres. Flags are - # specified with underscores, not hyphens. - # "value": The value of the flag. Booleans are set to **on** for true - # and **off** for false. This field must be omitted if the flag - # doesn't take a value. - # @!attribute [r] writable_node - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::Node] - # Output only. This is set for the read-write VM of the PRIMARY instance - # only. - # @!attribute [r] nodes - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance::Node>] - # Output only. List of available read-only VMs in this instance, including - # the standby for a PRIMARY instance. - # @!attribute [rw] query_insights_config - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::QueryInsightsInstanceConfig] - # Configuration for query insights. - # @!attribute [rw] observability_config - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ObservabilityInstanceConfig] - # Configuration for observability. - # @!attribute [rw] read_pool_config - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ReadPoolConfig] - # Read pool instance configuration. - # This is required if the value of instanceType is READ_POOL. - # @!attribute [r] ip_address - # @return [::String] - # Output only. The IP address for the Instance. - # This is the connection endpoint for an end-user application. - # @!attribute [r] public_ip_address - # @return [::String] - # Output only. The public IP addresses for the Instance. This is available - # ONLY when enable_public_ip is set. This is the connection endpoint for an - # end-user application. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Reconciling (https://google.aip.dev/128#reconciliation). - # Set to true if the current state of Instance does not match the user's - # intended state, and the service is actively updating the resource to - # reconcile them. This can happen due to user-triggered updates or - # system actions like failover or maintenance. - # @!attribute [rw] etag - # @return [::String] - # For Resource freshness validation (https://google.aip.dev/154) - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Annotations to allow client tools to store small amount of arbitrary data. - # This is distinct from labels. - # https://google.aip.dev/128 - # @!attribute [rw] update_policy - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::UpdatePolicy] - # Update policy that will be applied during instance update. - # This field is not persisted when you update the instance. - # To use a non-default update policy, you must - # specify explicitly specify the value in each update request. - # @!attribute [rw] client_connection_config - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ClientConnectionConfig] - # Optional. Client connection specific configurations - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. Reserved for future use. - # @!attribute [rw] psc_instance_config - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::PscInstanceConfig] - # Optional. The configuration for Private Service Connect (PSC) for the - # instance. - # @!attribute [rw] network_config - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::InstanceNetworkConfig] - # Optional. Instance-level network configuration. - # @!attribute [rw] gemini_config - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::AlloyDB::V1beta::GeminiInstanceConfig] - # Optional. Deprecated and unused. This field will be removed in the near - # future. - # @!attribute [r] outbound_public_ip_addresses - # @return [::Array<::String>] - # Output only. All outbound public IP addresses configured for the instance. - # @!attribute [rw] activation_policy - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ActivationPolicy] - # Optional. Specifies whether an instance needs to spin up. Once the instance - # is active, the activation policy can be updated to the `NEVER` to stop the - # instance. Likewise, the activation policy can be updated to `ALWAYS` to - # start the instance. - # There are restrictions around when an instance can/cannot be activated (for - # example, a read pool instance should be stopped before stopping primary - # etc.). Please refer to the API documentation for more details. - # @!attribute [rw] connection_pool_config - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::ConnectionPoolConfig] - # Optional. The configuration for Managed Connection Pool (MCP). - # @!attribute [r] gca_config - # @return [::Google::Cloud::AlloyDB::V1beta::GCAInstanceConfig] - # Output only. Configuration parameters related to Gemini Cloud Assist. - class Instance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # MachineConfig describes the configuration of a machine. - # @!attribute [rw] cpu_count - # @return [::Integer] - # The number of CPU's in the VM instance. - # @!attribute [rw] machine_type - # @return [::String] - # Machine type of the VM instance. E.g. "n2-highmem-4", - # "n2-highmem-8", "c4a-highmem-4-lssd". - # cpu_count must match the number of vCPUs in the machine type. - class MachineConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of a single node in the instance. - # Nodes in an AlloyDB instance are ephemeral, they can change during - # update, failover, autohealing and resize operations. - # @!attribute [r] zone_id - # @return [::String] - # Output only. The Compute Engine zone of the VM e.g. "us-central1-b". - # @!attribute [r] id - # @return [::String] - # Output only. The identifier of the VM e.g. - # "test-read-0601-407e52be-ms3l". - # @!attribute [r] ip - # @return [::String] - # Output only. The private IP address of the VM e.g. "10.57.0.34". - # @!attribute [r] state - # @return [::String] - # Output only. Determined by state of the compute VM and postgres-service - # health. Compute VM state can have values listed in - # https://cloud.google.com/compute/docs/instances/instance-life-cycle and - # postgres-service health can have values: HEALTHY and UNHEALTHY. - class Node - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # QueryInsights Instance specific configuration. - # @!attribute [rw] record_application_tags - # @return [::Boolean] - # Record application tags for an instance. - # This flag is turned "on" by default. - # @!attribute [rw] record_client_address - # @return [::Boolean] - # Record client address for an instance. Client address is PII information. - # This flag is turned "on" by default. - # @!attribute [rw] query_string_length - # @return [::Integer] - # Query string length. The default value is 1024. - # Any integer between 256 and 4500 is considered valid. - # @!attribute [rw] query_plans_per_minute - # @return [::Integer] - # Number of query execution plans captured by Insights per minute - # for all queries combined. The default value is 5. - # Any integer between 0 and 20 is considered valid. - class QueryInsightsInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Observability Instance specific configuration. - # @!attribute [rw] enabled - # @return [::Boolean] - # Observability feature status for an instance. - # This flag is turned "off" by default. - # @!attribute [rw] preserve_comments - # @return [::Boolean] - # Preserve comments in query string for an instance. - # This flag is turned "off" by default. - # @!attribute [rw] track_wait_events - # @return [::Boolean] - # Track wait events during query execution for an instance. - # This flag is turned "on" by default but tracking is enabled only after - # observability enabled flag is also turned on. - # @!attribute [r] track_wait_event_types - # @return [::Boolean] - # Output only. Track wait event types during query execution for an - # instance. This flag is turned "on" by default but tracking is enabled - # only after observability enabled flag is also turned on. This is - # read-only flag and only modifiable by internal API. - # @!attribute [rw] max_query_string_length - # @return [::Integer] - # Query string length. The default value is 10k. - # @!attribute [rw] record_application_tags - # @return [::Boolean] - # Record application tags for an instance. - # This flag is turned "off" by default. - # @!attribute [rw] query_plans_per_minute - # @return [::Integer] - # Number of query execution plans captured by Insights per minute - # for all queries combined. The default value is 200. - # Any integer between 0 to 200 is considered valid. - # @!attribute [rw] track_active_queries - # @return [::Boolean] - # Track actively running queries on the instance. - # If not set, this flag is "off" by default. - # @!attribute [rw] track_client_address - # @return [::Boolean] - # Track client address for an instance. - # If not set, default value is "off". - # @!attribute [rw] assistive_experiences_enabled - # @return [::Boolean] - # Whether assistive experiences are enabled for this AlloyDB instance. - class ObservabilityInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for a read pool instance. - # @!attribute [rw] node_count - # @return [::Integer] - # Read capacity, i.e. number of nodes in a read pool instance. - class ReadPoolConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Policy to be used while updating the instance. - # @!attribute [rw] mode - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::UpdatePolicy::Mode] - # Mode for updating the instance. - class UpdatePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Specifies the available modes of update. - module Mode - # Mode is unknown. - MODE_UNSPECIFIED = 0 - - # Least disruptive way to apply the update. - DEFAULT = 1 - - # Performs a forced update when applicable. This will be fast but may - # incur a downtime. - FORCE_APPLY = 2 - end - end - - # Client connection configuration - # @!attribute [rw] require_connectors - # @return [::Boolean] - # Optional. Configuration to enforce connectors only (ex: AuthProxy) - # connections to the database. - # @!attribute [rw] ssl_config - # @return [::Google::Cloud::AlloyDB::V1beta::SslConfig] - # Optional. SSL configuration option for this instance. - class ClientConnectionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for setting up a PSC interface to enable outbound - # connectivity. - # @!attribute [rw] network_attachment_resource - # @return [::String] - # The network attachment resource created in the consumer network to which - # the PSC interface will be linked. This is of the format: - # "projects/$\\{CONSUMER_PROJECT}/regions/$\\{REGION}/networkAttachments/$\\{NETWORK_ATTACHMENT_NAME}". - # The network attachment must be in the same region as the instance. - class PscInterfaceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for setting up PSC service automation. Consumer projects in - # the configs will be allowlisted automatically for the instance. - # @!attribute [rw] consumer_project - # @return [::String] - # The consumer project to which the PSC service automation endpoint will - # be created. - # @!attribute [rw] consumer_network - # @return [::String] - # The consumer network for the PSC service automation, example: - # "projects/vpc-host-project/global/networks/default". - # The consumer network might be hosted a different project than the - # consumer project. - # @!attribute [r] ip_address - # @return [::String] - # Output only. The IP address of the PSC service automation endpoint. - # @!attribute [r] status - # @return [::String] - # Output only. The status of the PSC service automation connection. - # Possible values: - # "STATE_UNSPECIFIED" - An invalid state as the default case. - # "ACTIVE" - The connection has been created successfully. - # "FAILED" - The connection is not functional since some resources on the - # connection fail to be created. - # "CREATING" - The connection is being created. - # "DELETING" - The connection is being deleted. - # "CREATE_REPAIRING" - The connection is being repaired to complete - # creation. - # "DELETE_REPAIRING" - The connection is being repaired to complete - # deletion. - # @!attribute [r] consumer_network_status - # @return [::String] - # Output only. The status of the service connection policy. - # Possible values: - # "STATE_UNSPECIFIED" - Default state, when Connection Map is created - # initially. - # "VALID" - Set when policy and map configuration is valid, and their - # matching can lead to allowing creation of PSC Connections subject to - # other constraints like connections limit. - # "CONNECTION_POLICY_MISSING" - No Service Connection Policy found for - # this network and Service Class - # "POLICY_LIMIT_REACHED" - Service Connection Policy limit reached for - # this network and Service Class - # "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" - The consumer instance - # project is not in AllowedGoogleProducersResourceHierarchyLevels of the - # matching ServiceConnectionPolicy. - class PscAutoConnectionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PscInstanceConfig contains PSC related configuration at an - # instance level. - # @!attribute [r] service_attachment_link - # @return [::String] - # Output only. The service attachment created when Private - # Service Connect (PSC) is enabled for the instance. - # The name of the resource will be in the format of - # `projects//regions//serviceAttachments/` - # @!attribute [rw] allowed_consumer_projects - # @return [::Array<::String>] - # Optional. List of consumer projects that are allowed to create - # PSC endpoints to service-attachments to this instance. - # @!attribute [r] psc_dns_name - # @return [::String] - # Output only. The DNS name of the instance for PSC connectivity. - # Name convention: ...alloydb-psc.goog - # @!attribute [rw] psc_interface_configs - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance::PscInterfaceConfig>] - # Optional. Configurations for setting up PSC interfaces attached to the - # instance which are used for outbound connectivity. Only primary instances - # can have PSC interface attached. Currently we only support 0 or 1 PSC - # interface. - # @!attribute [rw] psc_auto_connections - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance::PscAutoConnectionConfig>] - # Optional. Configurations for setting up PSC service automation. - class PscInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to instance-level network configuration. - # @!attribute [rw] authorized_external_networks - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance::InstanceNetworkConfig::AuthorizedNetwork>] - # Optional. A list of external network authorized to access this instance. - # @!attribute [rw] enable_public_ip - # @return [::Boolean] - # Optional. Enabling public ip for the instance. - # @!attribute [rw] enable_outbound_public_ip - # @return [::Boolean] - # Optional. Enabling an outbound public IP address to support a database - # server sending requests out into the internet. - # @!attribute [r] network - # @return [::String] - # Output only. The resource link for the VPC network in which instance - # resources are created and from which they are accessible via Private IP. - # This will be the same value as the parent cluster's network. It is - # specified in the form: // - # `projects/{project_number}/global/networks/{network_id}`. - # @!attribute [rw] allocated_ip_range_override - # @return [::String] - # Optional. Name of the allocated IP range for the private IP AlloyDB - # instance, for example: "google-managed-services-default". If set, the - # instance IPs will be created from this allocated range and will override - # the IP range used by the parent cluster. The range name must comply with - # [RFC 1035](http://datatracker.ietf.org/doc/html/rfc1035). Specifically, - # the name must be 1-63 characters long and match the regular expression - # [a-z]([-a-z0-9]*[a-z0-9])?. - class InstanceNetworkConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # AuthorizedNetwork contains metadata for an authorized network. - # @!attribute [rw] cidr_range - # @return [::String] - # CIDR range for one authorzied network of the instance. - class AuthorizedNetwork - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Configuration for Managed Connection Pool (MCP). - # @!attribute [rw] enabled - # @return [::Boolean] - # Optional. Whether to enable Managed Connection Pool (MCP). - # @!attribute [rw] flags - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Connection Pool flags, as a list of "key": "value" pairs. - # @!attribute [r] pooler_count - # @return [::Integer] - # Output only. The number of running poolers per instance. - class ConnectionPoolConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class FlagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class DatabaseFlagsEntry - 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 - - # Instance State - module State - # The state of the instance is unknown. - STATE_UNSPECIFIED = 0 - - # The instance is active and running. - READY = 1 - - # The instance is stopped. Instance name and IP resources are preserved. - STOPPED = 2 - - # The instance is being created. - CREATING = 3 - - # The instance is being deleted. - DELETING = 4 - - # The instance is down for maintenance. - MAINTENANCE = 5 - - # The creation of the instance failed or a fatal error occurred during - # an operation on the instance. - # Note: Instances in this state would tried to be auto-repaired. And - # Customers should be able to restart, update or delete these instances. - FAILED = 6 - - # Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that - # index unused in case that state also needs to exposed via consumer apis - # in future. - # The instance has been configured to sync data from some other source. - BOOTSTRAPPING = 8 - - # The instance is being promoted. - PROMOTING = 9 - end - - # Type of an Instance - module InstanceType - # The type of the instance is unknown. - INSTANCE_TYPE_UNSPECIFIED = 0 - - # PRIMARY instances support read and write operations. - PRIMARY = 1 - - # READ POOL instances support read operations only. Each read pool instance - # consists of one or more homogeneous nodes. - # * Read pool of size 1 can only have zonal availability. - # * Read pools with node count of 2 or more can have regional - # availability (nodes are present in 2 or more zones in a region). - READ_POOL = 2 - - # SECONDARY instances support read operations only. SECONDARY instance - # is a cross-region read replica - SECONDARY = 3 - end - - # The Availability type of an instance. Potential values: - # - # - ZONAL: The instance serves data from only one zone. Outages in that - # zone affect instance availability. - # - REGIONAL: The instance can serve data from more than one zone in a - # region (it is highly available). - module AvailabilityType - # This is an unknown Availability type. - AVAILABILITY_TYPE_UNSPECIFIED = 0 - - # Zonal available instance. - ZONAL = 1 - - # Regional (or Highly) available instance. - REGIONAL = 2 - end - - # Specifies whether an instance needs to spin up. - module ActivationPolicy - # The policy is not specified. - ACTIVATION_POLICY_UNSPECIFIED = 0 - - # The instance is running. - ALWAYS = 1 - - # The instance is not running. - NEVER = 2 - end - end - - # ConnectionInfo singleton resource. - # https://google.aip.dev/156 - # @!attribute [rw] name - # @return [::String] - # The name of the ConnectionInfo singleton resource, e.g.: - # projects/\\{project}/locations/\\{location}/clusters/*/instances/*/connectionInfo - # This field currently has no semantic meaning. - # @!attribute [r] ip_address - # @return [::String] - # Output only. The private network IP address for the Instance. This is the - # default IP for the instance and is always created (even if enable_public_ip - # is set). This is the connection endpoint for an end-user application. - # @!attribute [r] public_ip_address - # @return [::String] - # Output only. The public IP addresses for the Instance. This is available - # ONLY when enable_public_ip is set. This is the connection endpoint for an - # end-user application. - # @!attribute [r] pem_certificate_chain - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # Output only. The pem-encoded chain that may be used to verify the X.509 - # certificate. Expected to be in issuer-to-root order according to RFC 5246. - # @!attribute [r] instance_uid - # @return [::String] - # Output only. The unique ID of the Instance. - # @!attribute [r] psc_dns_name - # @return [::String] - # Output only. The DNS name to use with PSC for the Instance. - class ConnectionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing Backup object - # @!attribute [r] name - # @return [::String] - # Output only. The name of the backup resource with the format: - # * projects/\\{project}/locations/\\{region}/backups/\\{backup_id} - # where the cluster and backup ID segments should satisfy the regex - # expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of - # lowercase letters, numbers, and dashes, starting with a letter, and ending - # with a letter or number. For more details see https://google.aip.dev/122. - # The prefix of the backup resource name is the name of the parent - # resource: - # * projects/\\{project}/locations/\\{region} - # @!attribute [rw] display_name - # @return [::String] - # User-settable and human-readable display name for the Backup. - # @!attribute [r] uid - # @return [::String] - # Output only. The system-generated UID of the resource. The UID is assigned - # when the resource is created, and it is retained until it is deleted. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time stamp - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time stamp - # - # Users should not infer any meaning from this field. Its value is generally - # unrelated to the timing of the backup creation operation. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Delete time stamp - # @!attribute [r] create_completion_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp when the resource finished being created. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [r] state - # @return [::Google::Cloud::AlloyDB::V1beta::Backup::State] - # Output only. The current state of the backup. - # @!attribute [rw] type - # @return [::Google::Cloud::AlloyDB::V1beta::Backup::Type] - # The backup type, which suggests the trigger for the backup. - # @!attribute [rw] description - # @return [::String] - # User-provided description of the backup. - # @!attribute [r] cluster_uid - # @return [::String] - # Output only. The system-generated UID of the cluster which was used to - # create this resource. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The full resource name of the backup source cluster - # (e.g., projects/\\{project}/locations/\\{region}/clusters/\\{cluster_id}). - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Reconciling (https://google.aip.dev/128#reconciliation), if - # true, indicates that the service is actively updating the resource. This - # can happen due to user-triggered updates or system actions like failover or - # maintenance. - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionConfig] - # Optional. The encryption config can be specified to encrypt the - # backup with a customer-managed encryption key (CMEK). When this field is - # not specified, the backup will then use default encryption scheme to - # protect the user data. - # @!attribute [r] encryption_info - # @return [::Google::Cloud::AlloyDB::V1beta::EncryptionInfo] - # Output only. The encryption information for the backup. - # @!attribute [rw] etag - # @return [::String] - # For Resource freshness validation (https://google.aip.dev/154) - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Annotations to allow client tools to store small amount of arbitrary data. - # This is distinct from labels. - # https://google.aip.dev/128 - # @!attribute [r] size_bytes - # @return [::Integer] - # Output only. The size of the backup in bytes. - # @!attribute [r] expiry_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which after the backup is eligible to be garbage - # collected. It is the duration specified by the backup's retention policy, - # added to the backup's create_time. - # @!attribute [r] expiry_quantity - # @return [::Google::Cloud::AlloyDB::V1beta::Backup::QuantityBasedExpiry] - # Output only. The QuantityBasedExpiry of the backup, specified by the - # backup's retention policy. Once the expiry quantity is over retention, the - # backup is eligible to be garbage collected. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. Reserved for future use. - # @!attribute [r] database_version - # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] - # Output only. The database engine major version of the cluster this backup - # was created from. Any restored cluster created from this backup will have - # the same database version. - # @!attribute [rw] tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Input only. Immutable. Tag keys/values directly bound to this - # resource. For example: - # ``` - # "123/environment": "production", - # "123/costCenter": "marketing" - # ``` - class Backup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A backup's position in a quantity-based retention queue, of backups with - # the same source cluster and type, with length, retention, specified by the - # backup's retention policy. - # Once the position is greater than the retention, the backup is eligible to - # be garbage collected. - # - # Example: 5 backups from the same source cluster and type with a - # quantity-based retention of 3 and denoted by backup_id (position, - # retention). - # - # Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3). - # Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3) - # @!attribute [r] retention_count - # @return [::Integer] - # Output only. The backup's position among its backups with the same source - # cluster and type, by descending chronological order create time(i.e. - # newest first). - # @!attribute [r] total_retention_count - # @return [::Integer] - # Output only. The length of the quantity-based queue, specified by the - # backup's retention policy. - class QuantityBasedExpiry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Backup State - module State - # The state of the backup is unknown. - STATE_UNSPECIFIED = 0 - - # The backup is ready. - READY = 1 - - # The backup is creating. - CREATING = 2 - - # The backup failed. - FAILED = 3 - - # The backup is being deleted. - DELETING = 4 - end - - # Backup Type - module Type - # Backup Type is unknown. - TYPE_UNSPECIFIED = 0 - - # ON_DEMAND backups that were triggered by the customer (e.g., not - # AUTOMATED). - ON_DEMAND = 1 - - # AUTOMATED backups triggered by the automated backups scheduler pursuant - # to an automated backup policy. - AUTOMATED = 2 - - # CONTINUOUS backups triggered by the automated backups scheduler - # due to a continuous backup policy. - CONTINUOUS = 3 - end - end - - # SupportedDatabaseFlag gives general information about a database flag, - # like type and allowed values. This is a static value that is defined - # on the server side, and it cannot be modified by callers. - # To set the Database flags on a particular Instance, a caller should modify - # the Instance.database_flags field. - # @!attribute [rw] string_restrictions - # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::StringRestrictions] - # Restriction on STRING type value. - # - # Note: The following fields are mutually exclusive: `string_restrictions`, `integer_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] integer_restrictions - # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::IntegerRestrictions] - # Restriction on INTEGER type value. - # - # Note: The following fields are mutually exclusive: `integer_restrictions`, `string_restrictions`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] recommended_string_value - # @return [::String] - # The recommended value for a STRING flag. - # - # Note: The following fields are mutually exclusive: `recommended_string_value`, `recommended_integer_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] recommended_integer_value - # @return [::Google::Protobuf::Int64Value] - # The recommended value for an INTEGER flag. - # - # Note: The following fields are mutually exclusive: `recommended_integer_value`, `recommended_string_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # The name of the flag resource, following Google Cloud conventions, e.g.: - # * projects/\\{project}/locations/\\{location}/flags/\\{flag} - # This field currently has no semantic meaning. - # @!attribute [rw] flag_name - # @return [::String] - # The name of the database flag, e.g. "max_allowed_packets". - # The is a possibly key for the Instance.database_flags map field. - # @!attribute [rw] value_type - # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::ValueType] - # @!attribute [rw] accepts_multiple_values - # @return [::Boolean] - # Whether the database flag accepts multiple values. If true, - # a comma-separated list of stringified values may be specified. - # @!attribute [rw] supported_db_versions - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::DatabaseVersion>] - # Major database engine versions for which this flag is supported. - # @!attribute [rw] requires_db_restart - # @return [::Boolean] - # Whether setting or updating this flag on an Instance requires a database - # restart. If a flag that requires database restart is set, the backend - # will automatically restart the database (making sure to satisfy any - # availability SLO's). - # @!attribute [rw] scope - # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::Scope] - # The scope of the flag. - class SupportedDatabaseFlag - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Restrictions on STRING type values - # @!attribute [rw] allowed_values - # @return [::Array<::String>] - # The list of allowed values, if bounded. This field will be empty - # if there is a unbounded number of allowed values. - class StringRestrictions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Restrictions on INTEGER type values. - # @!attribute [rw] min_value - # @return [::Google::Protobuf::Int64Value] - # The minimum value that can be specified, if applicable. - # @!attribute [rw] max_value - # @return [::Google::Protobuf::Int64Value] - # The maximum value that can be specified, if applicable. - class IntegerRestrictions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ValueType describes the semantic type of the value that the flag accepts. - # Regardless of the ValueType, the Instance.database_flags field accepts the - # stringified version of the value, i.e. "20" or "3.14". - module ValueType - # This is an unknown flag type. - VALUE_TYPE_UNSPECIFIED = 0 - - # String type flag. - STRING = 1 - - # Integer type flag. - INTEGER = 2 - - # Float type flag. - FLOAT = 3 - - # Denotes that the flag does not accept any values. - NONE = 4 - end - - # The scope of the flag. - module Scope - # The scope of the flag is not specified. Default is DATABASE. - SCOPE_UNSPECIFIED = 0 - - # The flag is a database flag. - DATABASE = 1 - - # The flag is a connection pool flag. - CONNECTION_POOL = 2 - end - end - - # Message describing User object. - # @!attribute [r] name - # @return [::String] - # Output only. Name of the resource in the form of - # projects/\\{project}/locations/\\{location}/cluster/\\{cluster}/users/\\{user}. - # @!attribute [rw] password - # @return [::String] - # Input only. Password for the user. - # @!attribute [rw] database_roles - # @return [::Array<::String>] - # Optional. List of database roles this user has. - # The database role strings are subject to the PostgreSQL naming conventions. - # @!attribute [rw] user_type - # @return [::Google::Cloud::AlloyDB::V1beta::User::UserType] - # Optional. Type of this user. - # @!attribute [rw] keep_extra_roles - # @return [::Boolean] - # Input only. If the user already exists and it has additional roles, keep - # them granted. - class User - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that details the user type. - module UserType - # Unspecified user type. - USER_TYPE_UNSPECIFIED = 0 - - # The default user type that authenticates via password-based - # authentication. - ALLOYDB_BUILT_IN = 1 - - # Database user that can authenticate via IAM-Based authentication. - ALLOYDB_IAM_USER = 2 - end - end - - # Message describing Database object. - # @!attribute [rw] name - # @return [::String] - # Identifier. Name of the resource in the form of - # `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`. - # @!attribute [rw] charset - # @return [::String] - # Optional. Immutable. Charset for the database. - # This field can contain any PostgreSQL supported charset name. - # Example values include "UTF8", "SQL_ASCII", etc. - # @!attribute [rw] collation - # @return [::String] - # Optional. Immutable. lc_collate for the database. - # String sort order. - # Example values include "C", "POSIX", etc. - # @!attribute [rw] character_type - # @return [::String] - # Optional. Immutable. lc_ctype for the database. - # Character classification (What is a letter? The upper-case equivalent?). - # Example values include "C", "POSIX", etc. - # @!attribute [rw] is_template - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. Whether the database is a template database. - # Deprecated in favor of is_template_database. - # @!attribute [rw] database_template - # @return [::String] - # Input only. Immutable. Template of the database to be used for creating a - # new database. - # @!attribute [rw] is_template_database - # @return [::Boolean] - # Optional. Whether the database is a template database. - class Database - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # View on Instance. Pass this enum to rpcs that returns an Instance message to - # control which subsets of fields to get. - module InstanceView - # INSTANCE_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. - INSTANCE_VIEW_UNSPECIFIED = 0 - - # BASIC server responses for a primary or read instance include all the - # relevant instance details, excluding the details of each node in the - # instance. The default value. - INSTANCE_VIEW_BASIC = 1 - - # FULL response is equivalent to BASIC for primary instance (for now). - # For read pool instance, this includes details of each node in the pool. - INSTANCE_VIEW_FULL = 2 - end - - # View on Cluster. Pass this enum to rpcs that returns a cluster message to - # control which subsets of fields to get. - module ClusterView - # CLUSTER_VIEW_UNSPECIFIED Not specified, equivalent to BASIC. - CLUSTER_VIEW_UNSPECIFIED = 0 - - # BASIC server responses include all the relevant cluster details, excluding - # Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific - # fields. The default value. - CLUSTER_VIEW_BASIC = 1 - - # CONTINUOUS_BACKUP response returns all the fields from BASIC plus - # the earliest restorable time if continuous backups are enabled. - # May increase latency. - CLUSTER_VIEW_CONTINUOUS_BACKUP = 2 - end - - # The supported database engine versions. - module DatabaseVersion - # This is an unknown database version. - DATABASE_VERSION_UNSPECIFIED = 0 - - # DEPRECATED - The database version is Postgres 13. - POSTGRES_13 = 1 - - # The database version is Postgres 14. - POSTGRES_14 = 2 - - # The database version is Postgres 15. - POSTGRES_15 = 3 - - # The database version is Postgres 16. - POSTGRES_16 = 4 - - # The database version is Postgres 17. - POSTGRES_17 = 5 - - # The database version is Postgres 18. - POSTGRES_18 = 6 - end - - # Subscription_type added to distinguish between Standard and Trial - # subscriptions. By default, a subscription type is considered STANDARD unless - # explicitly specified. - module SubscriptionType - # This is an unknown subscription type. By default, the subscription type is - # STANDARD. - SUBSCRIPTION_TYPE_UNSPECIFIED = 0 - - # Standard subscription. - STANDARD = 1 - - # Trial subscription. - TRIAL = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/service.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/service.rb deleted file mode 100644 index 7ddbd54d52a6..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/cloud/alloydb/v1beta/service.rb +++ /dev/null @@ -1,1871 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module AlloyDB - module V1beta - # Message for requesting list of Clusters - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Cluster.name field. Additionally, you can perform an - # aggregated list operation by specifying a value with the following format: - # * projects/\\{project}/locations/- - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Optional. Hint for how to order the results - class ListClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Clusters - # @!attribute [rw] clusters - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Cluster>] - # The list of Cluster - # @!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 ListClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Cluster - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field. - # @!attribute [rw] view - # @return [::Google::Cloud::AlloyDB::V1beta::ClusterView] - # Optional. The view of the cluster to return. Returns all default fields if - # not set. - class GetClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] parent - # @return [::String] - # Required. The location of the new cluster. For the required - # format, see the comment on the Cluster.name field. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. ID of the requesting object (the secondary cluster). - # @!attribute [rw] cluster - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] - # Required. Configuration of the requesting object (the secondary cluster). - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class CreateSecondaryClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Cluster - # @!attribute [rw] parent - # @return [::String] - # Required. The location of the new cluster. For the required format, see the - # comment on the Cluster.name field. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. ID of the requesting object. - # @!attribute [rw] cluster - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] - # 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class CreateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Cluster - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Cluster 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] cluster - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] - # 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set to true, update succeeds even if cluster is not found. In - # that case, a new cluster is created and `update_mask` is ignored. - class UpdateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Destination for Export. Export will be done to cloud storage. - # @!attribute [rw] uri - # @return [::String] - # Required. The path to the file in Google Cloud Storage where the export - # will be stored. The URI is in the form `gs://bucketName/fileName`. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Export cluster request. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::AlloyDB::V1beta::GcsDestination] - # Required. Option to export data to cloud storage. - # @!attribute [rw] csv_export_options - # @return [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::CsvExportOptions] - # Options for exporting data in CSV format. Required field to be set for - # CSV file type. - # - # Note: The following fields are mutually exclusive: `csv_export_options`, `sql_export_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] sql_export_options - # @return [::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::SqlExportOptions] - # Options for exporting data in SQL format. Required field to be set for - # SQL file type. - # - # Note: The following fields are mutually exclusive: `sql_export_options`, `csv_export_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the cluster. - # @!attribute [rw] database - # @return [::String] - # Required. Name of the database where the export command will be executed. - # Note - Value provided should be the same as expected from - # `SELECT current_database();` and NOT as a resource reference. - class ExportClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options for exporting data in CSV format. - # @!attribute [rw] select_query - # @return [::String] - # Required. The SELECT query used to extract the data. - # @!attribute [rw] field_delimiter - # @return [::String] - # Optional. Specifies the character that separates columns within each row - # (line) of the file. The default is comma. The value of this argument has - # to be a character in Hex ASCII Code. - # @!attribute [rw] quote_character - # @return [::String] - # Optional. Specifies the quoting character to be used when a data value is - # quoted. The default is double-quote. The value of this argument has to be - # a character in Hex ASCII Code. - # @!attribute [rw] escape_character - # @return [::String] - # Optional. Specifies the character that should appear before a data - # character that needs to be escaped. The default is the same as quote - # character. The value of this argument has to be a character in Hex ASCII - # Code. - class CsvExportOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for exporting data in SQL format. - # @!attribute [rw] tables - # @return [::Array<::String>] - # Optional. Tables to export from. - # @!attribute [rw] schema_only - # @return [::Boolean] - # Optional. If true, only export the schema. - # @!attribute [rw] clean_target_objects - # @return [::Boolean] - # Optional. If true, output commands to DROP all the dumped database - # objects prior to outputting the commands for creating them. - # @!attribute [rw] if_exist_target_objects - # @return [::Boolean] - # Optional. If true, use DROP ... IF EXISTS commands to check for the - # object's existence before dropping it in clean_target_objects mode. - class SqlExportOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response of export cluster rpc. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::AlloyDB::V1beta::GcsDestination] - # Required. Option to export data to cloud storage. - class ExportClusterResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Import cluster request. - # @!attribute [rw] sql_import_options - # @return [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::SqlImportOptions] - # Options for importing data in SQL format. - # - # Note: The following fields are mutually exclusive: `sql_import_options`, `csv_import_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] csv_import_options - # @return [::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::CsvImportOptions] - # Options for importing data in CSV format. - # - # Note: The following fields are mutually exclusive: `csv_import_options`, `sql_import_options`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the cluster. - # @!attribute [rw] gcs_uri - # @return [::String] - # Required. The path to the file in Google Cloud Storage where the source - # file for import will be stored. The URI is in the form - # `gs://bucketName/fileName`. - # @!attribute [rw] database - # @return [::String] - # Optional. Name of the database to which the import will be done. - # For import from SQL file, this is required only if the file does not - # specify a database. - # Note - Value provided should be the same as expected from `SELECT - # current_database();` and NOT as a resource reference. - # @!attribute [rw] user - # @return [::String] - # Optional. Database user to be used for importing the data. - # Note - Value provided should be the same as expected from - # `SELECT current_user;` and NOT as a resource reference. - class ImportClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options for importing data in SQL format. - class SqlImportOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options for importing data in CSV format. - # @!attribute [rw] table - # @return [::String] - # Required. The database table to import CSV file into. - # @!attribute [rw] columns - # @return [::Array<::String>] - # Optional. The columns to which CSV data is imported. If not specified, - # all columns of the database table are loaded with CSV data. - # @!attribute [rw] field_delimiter - # @return [::String] - # Optional. Specifies the character that separates columns within each row - # (line) of the file. The default is comma. The value of this argument has - # to be a character in Hex ASCII Code. - # @!attribute [rw] quote_character - # @return [::String] - # Optional. Specifies the quoting character to be used when a data value is - # quoted. The default is double-quote. The value of this argument has to be - # a character in Hex ASCII Code. - # @!attribute [rw] escape_character - # @return [::String] - # Optional. Specifies the character that should appear before a data - # character that needs to be escaped. The default is same as quote - # character. The value of this argument has to be a character in Hex ASCII - # Code. - class CsvImportOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response of import rpc. - # @!attribute [rw] bytes_downloaded - # @return [::Integer] - # Required. Size of the object downloaded from Google Cloud Storage in bytes. - class ImportClusterResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Upgrades a cluster. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the cluster. - # @!attribute [rw] version - # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] - # Required. The version the cluster is going to be upgraded to. - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @!attribute [rw] etag - # @return [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # upgrade will be blocked and an ABORTED error will be returned. - class UpgradeClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UpgradeClusterResponse contains the response for upgrade cluster operation. - # @!attribute [rw] status - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] - # Status of upgrade operation. - # @!attribute [rw] message - # @return [::String] - # A user friendly message summarising the upgrade operation details and the - # next steps for the user if there is any. - # @!attribute [rw] cluster_upgrade_details - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::ClusterUpgradeDetails>] - # Array of upgrade details for the current cluster and all the secondary - # clusters associated with this cluster. - class UpgradeClusterResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Stage information for different stages in the upgrade process. - # @!attribute [rw] stage - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Stage] - # The stage. - # @!attribute [rw] status - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] - # Status of the stage. - # @!attribute [rw] logs_url - # @return [::String] - # logs_url is the URL for the logs associated with a stage if that stage - # has logs. Right now, only three stages have logs: ALLOYDB_PRECHECK, - # PG_UPGRADE_CHECK, PRIMARY_INSTANCE_UPGRADE. - class StageInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details regarding the upgrade of instances associated with a cluster. - # @!attribute [rw] name - # @return [::String] - # Normalized name of the instance. - # @!attribute [rw] upgrade_status - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] - # Upgrade status of the instance. - # @!attribute [rw] instance_type - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::InstanceType] - # Instance type. - class InstanceUpgradeDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Upgrade details of a cluster. This cluster can be primary or secondary. - # @!attribute [rw] name - # @return [::String] - # Normalized name of the cluster - # @!attribute [rw] upgrade_status - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] - # Upgrade status of the cluster. - # @!attribute [rw] cluster_type - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster::ClusterType] - # Cluster type which can either be primary or secondary. - # @!attribute [rw] database_version - # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] - # Database version of the cluster after the upgrade operation. This will be - # the target version if the upgrade was successful otherwise it remains the - # same as that before the upgrade operation. - # @!attribute [rw] stage_info - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::StageInfo>] - # Array containing stage info associated with this cluster. - # @!attribute [rw] instance_upgrade_details - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::InstanceUpgradeDetails>] - # Upgrade details of the instances directly associated with this cluster. - class ClusterUpgradeDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Status of upgrade operation. - module Status - # Unspecified status. - STATUS_UNSPECIFIED = 0 - - # Not started. - NOT_STARTED = 4 - - # In progress. - IN_PROGRESS = 5 - - # Operation succeeded. - SUCCESS = 1 - - # Operation failed. - FAILED = 2 - - # Operation partially succeeded. - PARTIAL_SUCCESS = 3 - - # Cancel is in progress. - CANCEL_IN_PROGRESS = 6 - - # Cancellation complete. - CANCELLED = 7 - end - - # Stage in the upgrade. - module Stage - # Unspecified stage. - STAGE_UNSPECIFIED = 0 - - # Pre-upgrade custom checks, not covered by pg_upgrade. - ALLOYDB_PRECHECK = 1 - - # Pre-upgrade pg_upgrade checks. - PG_UPGRADE_CHECK = 2 - - # Clone the original cluster. - PREPARE_FOR_UPGRADE = 5 - - # Upgrade the primary instance(downtime). - PRIMARY_INSTANCE_UPGRADE = 3 - - # This stage is read pool upgrade. - READ_POOL_INSTANCES_UPGRADE = 4 - - # Rollback in case of critical failures. - ROLLBACK = 6 - - # Cleanup. - CLEANUP = 7 - end - end - - # Message for deleting a Cluster - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field. - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] etag - # @return [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # deletion will be blocked and an ABORTED error will be returned. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @!attribute [rw] force - # @return [::Boolean] - # Optional. Whether to cascade delete child instances for given cluster. - class DeleteClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for switching over to a cluster - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class SwitchoverClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for promoting a Cluster - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Cluster.name field - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] etag - # @return [::String] - # Optional. The current etag of the Cluster. - # If an etag is provided and does not match the current etag of the Cluster, - # deletion will be blocked and an ABORTED error will be returned. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class PromoteClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for restoring a Cluster from a backup or another cluster at a given - # point in time. - # NEXT_ID: 11 - # @!attribute [rw] backup_source - # @return [::Google::Cloud::AlloyDB::V1beta::BackupSource] - # Backup source. - # - # Note: The following fields are mutually exclusive: `backup_source`, `continuous_backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] continuous_backup_source - # @return [::Google::Cloud::AlloyDB::V1beta::ContinuousBackupSource] - # ContinuousBackup source. Continuous backup needs to be enabled in the - # source cluster for this operation to succeed. - # - # Note: The following fields are mutually exclusive: `continuous_backup_source`, `backup_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Cluster.name field. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. ID of the requesting object. - # @!attribute [rw] cluster - # @return [::Google::Cloud::AlloyDB::V1beta::Cluster] - # 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class RestoreClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Instances - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Instance.name field. Additionally, you can perform an - # aggregated list operation by specifying a value with one of the following - # formats: - # * projects/\\{project}/locations/-/clusters/- - # * projects/\\{project}/locations/\\{region}/clusters/- - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Optional. Hint for how to order the results - class ListInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Instances - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance>] - # The list of Instance - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Instance - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @!attribute [rw] view - # @return [::Google::Cloud::AlloyDB::V1beta::InstanceView] - # The view of the instance to return. - class GetInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Instance - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Instance.name field. - # @!attribute [rw] instance_id - # @return [::String] - # Required. ID of the requesting object. - # @!attribute [rw] instance - # @return [::Google::Cloud::AlloyDB::V1beta::Instance] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class CreateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Secondary Instance - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. For the required format, see the - # comment on the Instance.name field. - # @!attribute [rw] instance_id - # @return [::String] - # Required. ID of the requesting object. - # @!attribute [rw] instance - # @return [::Google::Cloud::AlloyDB::V1beta::Instance] - # Required. The resource being created - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class CreateSecondaryInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # See usage below for notes. - # @!attribute [rw] create_instance_requests - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest>] - # Required. Primary and read replica instances to be created. This list - # should not be empty. - class CreateInstanceRequests - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a batch of instances under the specified cluster. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. - # @!attribute [rw] requests - # @return [::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests] - # Required. Resources 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating 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 BatchCreateInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating batches of instances in a cluster. - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Instance>] - # Created instances. - class BatchCreateInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for metadata that is specific to BatchCreateInstances API. - # NEXT_ID: 3 - # @!attribute [rw] instance_targets - # @return [::Array<::String>] - # The instances being created in the API call. Each string in this list - # is the server defined resource path for target instances in the request - # and for the format of each string, see the comment on the Instance.name - # field. - # @!attribute [rw] instance_statuses - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstanceStatus}] - # A map representing state of the instances involved in the - # BatchCreateInstances operation during the operation execution. - # The instance state will be in STATE_UNSPECIFIED state if the instance has - # not yet been picked up for processing. - # The key of the map is the name of the instance resource. - # For the format, see the comment on the Instance.name field. - class BatchCreateInstancesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstanceStatus] - class InstanceStatusesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message for current status of an instance in the BatchCreateInstances - # operation. - # For example, lets say a BatchCreateInstances workflow has 4 instances, - # Instance1 through Instance4. Lets also assume that 2 instances succeeded - # but the third failed to create and the 4th was never picked up for creation - # because of failure of the previous one. Then, resulting states would look - # something like: - # 1. Instance1 = ROLLED_BACK - # 2. Instance2 = ROLLED_BACK - # 3. Instance3 = FAILED - # 4. Instance4 = FAILED - # - # However, while the operation is running, the instance might be in other - # states including PENDING_CREATE, ACTIVE, DELETING and CREATING. The states - # / do not get further updated once the operation is done. - # @!attribute [rw] state - # @return [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstanceStatus::State] - # The current state of an instance involved in the batch create operation. - # Once the operation is complete, the final state of the instances in the - # LRO can be one of: - # 1. ACTIVE, indicating that instances were created successfully - # 2. FAILED, indicating that a particular instance failed creation - # 3. ROLLED_BACK indicating that although the instance was created - # successfully, it had to be rolled back and deleted due to failure in - # other steps of the workflow. - # @!attribute [rw] error_msg - # @return [::String] - # DEPRECATED - Use the error field instead. - # Error, if any error occurred and is available, during instance creation. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The RPC status of the instance creation operation. This field will be - # present if an error happened during the instance creation. - # @!attribute [rw] type - # @return [::Google::Cloud::AlloyDB::V1beta::Instance::InstanceType] - class BatchCreateInstanceStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State contains all valid instance states for the BatchCreateInstances - # operation. This is mainly used for status reporting through the LRO - # metadata. - module State - # The state of the instance is unknown. - STATE_UNSPECIFIED = 0 - - # Instance is pending creation and has not yet been picked up for - # processing in the backend. - PENDING_CREATE = 1 - - # The instance is active and running. - READY = 2 - - # The instance is being created. - CREATING = 3 - - # The instance is being deleted. - DELETING = 4 - - # The creation of the instance failed or a fatal error occurred during - # an operation on the instance or a batch of instances. - FAILED = 5 - - # The instance was created successfully, but was rolled back and deleted - # due to some other failure during BatchCreateInstances operation. - ROLLED_BACK = 6 - end - end - - # Message for updating a Instance - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Instance 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] instance - # @return [::Google::Cloud::AlloyDB::V1beta::Instance] - # 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set to true, update succeeds even if instance is not found. In - # that case, a new instance is created and `update_mask` is ignored. - class UpdateInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Instance - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] etag - # @return [::String] - # Optional. The current etag of the Instance. - # If an etag is provided and does not match the current etag of the Instance, - # deletion will be blocked and an ABORTED error will be returned. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class DeleteInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for triggering failover on an Instance - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class FailoverInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for triggering fault injection on an instance - # @!attribute [rw] fault_type - # @return [::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest::FaultType] - # Required. The type of fault to be injected in an instance. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - class InjectFaultRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # FaultType contains all valid types of faults that can be injected to an - # instance. - module FaultType - # The fault type is unknown. - FAULT_TYPE_UNSPECIFIED = 0 - - # Stop the VM - STOP_VM = 1 - end - end - - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the Instance.name field. - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, performs request validation, for example, permission - # checks and any other type of validation, but does not actually execute the - # create request. - # @!attribute [rw] node_ids - # @return [::Array<::String>] - # Optional. Full name of the nodes as obtained from INSTANCE_VIEW_FULL to - # restart upon. Applicable only to read instances. - class RestartInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for ExecuteSql rpc. - # @!attribute [rw] password - # @return [::String] - # Optional. The database native user’s password. - # @!attribute [rw] instance - # @return [::String] - # Required. The instance where the SQL will be executed. For the required - # format, see the comment on the Instance.name field. - # @!attribute [rw] database - # @return [::String] - # Required. Name of the database where the query will be executed. - # Note - Value provided should be the same as expected from `SELECT - # current_database();` and NOT as a resource reference. - # @!attribute [rw] user - # @return [::String] - # Required. Database user to be used for executing the SQL. - # Note - Value provided should be the same as expected from - # `SELECT current_user;` and NOT as a resource reference. - # @!attribute [rw] sql_statement - # @return [::String] - # Required. SQL statement to execute on database. Any valid statement is - # permitted, including DDL, DML, DQL statements. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validates the sql statement by performing - # syntax and semantic validation and doesn't execute the query. - class ExecuteSqlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Execute a SQL statement response. - # @!attribute [rw] sql_results - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SqlResult>] - # SqlResult represents the results for the execution of sql statements. - # @!attribute [rw] metadata - # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlMetadata] - # Any additional metadata information regarding the execution of the sql - # statement. - class ExecuteSqlResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Any additional metadata information regarding the execution of the SQL - # @!attribute [rw] message - # @return [::String] - # Message related to SQL execution. Marked as core content since it - # can potentially contain details related to the query or result set. This - # field can be used to convey messages such as "when the SQL result set - # exceeds the acceptable response size limits." - # @!attribute [rw] partial_result - # @return [::Boolean] - # Set to true if SQL returned a result set larger than the acceptable - # response size limits and the result was truncated. - # @!attribute [rw] sql_statement_execution_duration - # @return [::Google::Protobuf::Duration] - # The time duration taken to execute the sql statement. - # @!attribute [rw] status - # @return [::Google::Cloud::AlloyDB::V1beta::ExecuteSqlMetadata::Status] - # Status of SQL execution. - class ExecuteSqlMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Status contains all valid Status a SQL execution can end up in. - module Status - # The status is unknown. - STATUS_UNSPECIFIED = 0 - - # No error during SQL execution i.e. All SQL statements ran to completion. - # The "message" will be empty. - OK = 1 - - # Same as OK, except indicates that only partial results were - # returned. The "message" field will contain details on why results were - # truncated. - PARTIAL = 2 - - # Error during SQL execution. Atleast 1 SQL statement execution resulted in - # a error. Side effects of other statements are rolled back. The "message" - # field will contain human readable error given by Postgres of the first - # bad SQL statement. SQL execution errors don't constitute API errors as - # defined in https://google.aip.dev/193 but will be returned as part of - # this message. - ERROR = 3 - end - end - - # Message for requesting list of Backups - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListBackupsRequest - # @!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 ListBackupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Backups - # @!attribute [rw] backups - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Backup>] - # The list of Backup - # @!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 ListBackupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Backup - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - class GetBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Backup - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] backup_id - # @return [::String] - # Required. ID of the requesting object. - # @!attribute [rw] backup - # @return [::Google::Cloud::AlloyDB::V1beta::Backup] - # 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - class CreateBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Backup - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Backup 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] backup - # @return [::Google::Cloud::AlloyDB::V1beta::Backup] - # 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set to true, update succeeds even if instance is not found. In - # that case, a new backup is created and `update_mask` is ignored. - class UpdateBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Backup - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. For the required format, see the comment on - # the Backup.name field. - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @!attribute [rw] etag - # @return [::String] - # Optional. The current etag of the Backup. - # If an etag is provided and does not match the current etag of the Backup, - # deletion will be blocked and an ABORTED error will be returned. - class DeleteBackupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for listing the information about the supported Database flags. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. The required format is: - # * projects/\\{project}/locations/\\{location} - # - # Regardless of the parent specified here, as long it is contains a valid - # project and location, the service will return a static list of supported - # flags resources. Note that we do not yet support region-specific - # flags. - # @!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] scope - # @return [::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag::Scope] - # Optional. The scope for which supported flags are requested. If not - # specified, default is DATABASE. - class ListSupportedDatabaseFlagsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing SupportedDatabaseFlags. - # @!attribute [rw] supported_database_flags - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag>] - # The list of SupportedDatabaseFlags. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListSupportedDatabaseFlagsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requests to generate a client certificate signed by the Cluster - # CA. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. The required format is: - # * projects/\\{project}/locations/\\{location}/clusters/\\{cluster} - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] pem_csr - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. A pem-encoded X.509 certificate signing request (CSR). It is - # recommended to use public_key instead. - # @!attribute [rw] cert_duration - # @return [::Google::Protobuf::Duration] - # Optional. An optional hint to the endpoint to generate the client - # certificate with the requested duration. The duration can be from 1 hour to - # 24 hours. The endpoint may or may not honor the hint. If the hint is left - # unspecified or is not honored, then the endpoint will pick an appropriate - # default duration. - # @!attribute [rw] public_key - # @return [::String] - # Optional. The public key from the client. - # @!attribute [rw] use_metadata_exchange - # @return [::Boolean] - # Optional. An optional hint to the endpoint to generate a client certificate - # that can be used by AlloyDB connectors to exchange additional metadata with - # the server after TLS handshake. - class GenerateClientCertificateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned by a GenerateClientCertificate operation. - # @!attribute [r] pem_certificate - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Output only. The pem-encoded, signed X.509 certificate. - # @!attribute [r] pem_certificate_chain - # @return [::Array<::String>] - # Output only. The pem-encoded chain that may be used to verify the X.509 - # certificate. Expected to be in issuer-to-root order according to RFC 5246. - # @!attribute [rw] ca_cert - # @return [::String] - # Optional. The pem-encoded cluster ca X.509 certificate. - class GenerateClientCertificateResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetConnectionInfo. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the parent resource. The required format is: - # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance} - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating 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 GetConnectionInfoRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] batch_create_instances_metadata - # @return [::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesMetadata] - # Output only. BatchCreateInstances related metadata. - # - # Note: The following fields are mutually exclusive: `batch_create_instances_metadata`, `promote_cluster_status`, `upgrade_cluster_status`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] promote_cluster_status - # @return [::Google::Cloud::AlloyDB::V1beta::PromoteClusterStatus] - # Output only. PromoteClusterStatus related metadata. - # - # Note: The following fields are mutually exclusive: `promote_cluster_status`, `batch_create_instances_metadata`, `upgrade_cluster_status`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] upgrade_cluster_status - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus] - # Output only. UpgradeClusterStatus related metadata. - # - # Note: The following fields are mutually exclusive: `upgrade_cluster_status`, `batch_create_instances_metadata`, `promote_cluster_status`. 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 the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have - # {::Google::Longrunning::Operation#error google.longrunning.Operation.error} - # value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for current status of the database during Promote Cluster operation. - # @!attribute [r] state - # @return [::Google::Cloud::AlloyDB::V1beta::PromoteClusterStatus::State] - # Output only. The current state of the promoted secondary's database. - # Once the operation is complete, the final state of the database in the - # LRO can be one of: - # 1. PROMOTE_CLUSTER_AVAILABLE_FOR_READ, indicating that the promote - # operation has failed mid-way, the database is still only available for - # read. - # 2. PROMOTE_CLUSTER_COMPLETED, indicating that a promote operation - # completed successfully. The database is available for both read and write - # requests - class PromoteClusterStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State contains all valid states of the database during promote cluster - # operation. This is used for status reporting through the LRO metadata. - module State - # The state of the database is unknown. - STATE_UNSPECIFIED = 0 - - # The database is only available for read. - PROMOTE_CLUSTER_AVAILABLE_FOR_READ = 1 - - # The database is available for both read and write. The promote operation - # is near completion. - PROMOTE_CLUSTER_AVAILABLE_FOR_WRITE = 2 - - # The promote operation is completed and the database is available for - # write. - PROMOTE_CLUSTER_COMPLETED = 3 - end - end - - # Message for current status of the Major Version Upgrade operation. - # @!attribute [rw] state - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] - # Cluster Major Version Upgrade state. - # @!attribute [rw] cancellable - # @return [::Boolean] - # Whether the operation is cancellable. - # @!attribute [rw] source_version - # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] - # Source database major version. - # @!attribute [rw] target_version - # @return [::Google::Cloud::AlloyDB::V1beta::DatabaseVersion] - # Target database major version. - # @!attribute [rw] stages - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus::StageStatus>] - # Status of all upgrade stages. - class UpgradeClusterStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Status of an upgrade stage. - # @!attribute [rw] read_pool_instances_upgrade - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus::ReadPoolInstancesUpgradeStageStatus] - # Read pool instances upgrade metadata. - # @!attribute [rw] stage - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Stage] - # Upgrade stage. - # @!attribute [rw] state - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterResponse::Status] - # State of this stage. - # @!attribute [r] schedule - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus::StageStatus::StageSchedule] - # Output only. Timing information for the stage execution. - class StageStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Timing information for the stage execution. - # @!attribute [rw] estimated_start_time - # @return [::Google::Protobuf::Timestamp] - # When the stage is expected to start. Set only if the stage has not - # started yet. - # @!attribute [rw] actual_start_time - # @return [::Google::Protobuf::Timestamp] - # Actual start time of the stage. Set only if the stage has started. - # @!attribute [rw] estimated_end_time - # @return [::Google::Protobuf::Timestamp] - # When the stage is expected to end. Set only if the stage has not - # completed yet. - # @!attribute [rw] actual_end_time - # @return [::Google::Protobuf::Timestamp] - # Actual end time of the stage. Set only if the stage has completed. - class StageSchedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Read pool instances upgrade specific status. - # @!attribute [rw] upgrade_stats - # @return [::Google::Cloud::AlloyDB::V1beta::UpgradeClusterStatus::ReadPoolInstancesUpgradeStageStatus::Stats] - # Read pool instances upgrade statistics. - class ReadPoolInstancesUpgradeStageStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Upgrade stats for read pool instances. - # @!attribute [rw] not_started - # @return [::Integer] - # Number of read pool instances for which upgrade has not started. - # @!attribute [rw] ongoing - # @return [::Integer] - # Number of read pool instances undergoing upgrade. - # @!attribute [rw] success - # @return [::Integer] - # Number of read pool instances successfully upgraded. - # @!attribute [rw] failed - # @return [::Integer] - # Number of read pool instances which failed to upgrade. - class Stats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Message for requesting list of Users - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListUsersRequest - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Optional. Hint for how to order the results - class ListUsersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Users - # @!attribute [rw] users - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::User>] - # The list of User - # @!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 ListUsersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a User - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the User.name field. - class GetUserRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a User - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] user_id - # @return [::String] - # Required. ID of the requesting object. - # @!attribute [rw] user - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - class CreateUserRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a User - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # User 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] user - # @return [::Google::Cloud::AlloyDB::V1beta::User] - # 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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. Allow missing fields in the update mask. - class UpdateUserRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a User - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource. For the required format, see the - # comment on the User.name field. - # @!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 ignores the - # request if it has already been completed. The server guarantees that for at - # least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, ignores the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, the backend validates the request, but doesn't actually - # execute it. - class DeleteUserRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for ListDatabases request. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListDatabasesRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of databases to return. The service may return - # fewer than this value. If unspecified, 2000 is the default page_size. The - # max value of page_size will be 4000, values above max will be coerced to - # max. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListDatabases` call. - # This should be provided to retrieve the subsequent page. - # This field is currently not supported, its value will be ignored if passed. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering results. - # This field is currently not supported, its value will be ignored if passed. - class ListDatabasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for ListDatabases response. - # @!attribute [rw] databases - # @return [::Array<::Google::Cloud::AlloyDB::V1beta::Database>] - # The list of databases. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying the next page of results the server should return. - # If this field is omitted, there are no subsequent pages. - class ListDatabasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for CreateDatabase request. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] database_id - # @return [::String] - # Required. ID of the requesting object. - # @!attribute [rw] database - # @return [::Google::Cloud::AlloyDB::V1beta::Database] - # Required. The resource being created. - class CreateDatabaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index f2d9d79d9da4..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 9e9bdbb09ea4..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index 341efa296c29..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index c2acab1235a9..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index ad3c3ad25f0f..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index a005f395ccab..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 54bd4318d321..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/rpc/status.rb deleted file mode 100644 index 3f61f95b2587..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/type/date.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/date.rb deleted file mode 100644 index 2f4a77319e09..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/date.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/type/dayofweek.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/dayofweek.rb deleted file mode 100644 index c271eea096ba..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/dayofweek.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a day of the week. - module DayOfWeek - # The day of the week is unspecified. - DAY_OF_WEEK_UNSPECIFIED = 0 - - # Monday - MONDAY = 1 - - # Tuesday - TUESDAY = 2 - - # Wednesday - WEDNESDAY = 3 - - # Thursday - THURSDAY = 4 - - # Friday - FRIDAY = 5 - - # Saturday - SATURDAY = 6 - - # Sunday - SUNDAY = 7 - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/expr.rb deleted file mode 100644 index 9505eeb8657e..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/proto_docs/google/type/timeofday.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/timeofday.rb deleted file mode 100644 index 842b79be8a96..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/proto_docs/google/type/timeofday.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -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-alloy_db-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/Gemfile deleted file mode 100644 index f9832e65f5bc..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-alloy_db-v1beta", path: "../" -else - gem "google-cloud-alloy_db-v1beta" -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-alloy_db-v1beta/snippets/alloy_db_admin/batch_create_instances.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/batch_create_instances.rb deleted file mode 100644 index a70279ec328a..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/batch_create_instances.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the batch_create_instances call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#batch_create_instances. -# -def batch_create_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new - - # Call the batch_create_instances method. - result = client.batch_create_instances request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_backup.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_backup.rb deleted file mode 100644 index 681d2376051d..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_backup.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the create_backup call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_backup. -# -def create_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::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 alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_cluster.rb deleted file mode 100644 index 415c4db156d7..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the create_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_cluster. -# -def create_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new - - # Call the create_cluster method. - result = client.create_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_database.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_database.rb deleted file mode 100644 index 7252a3391b23..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_database.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the create_database call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_database. -# -def create_database - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new - - # Call the create_database method. - result = client.create_database request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::Database. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_instance.rb deleted file mode 100644 index ada47ffb7fa9..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the create_instance call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_instance. -# -def create_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::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 alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_cluster.rb deleted file mode 100644 index 9d350de6a6a9..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the create_secondary_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_cluster. -# -def create_secondary_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new - - # Call the create_secondary_cluster method. - result = client.create_secondary_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_instance.rb deleted file mode 100644 index 9f5afe6abf31..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_secondary_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the create_secondary_instance call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_instance. -# -def create_secondary_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new - - # Call the create_secondary_instance method. - result = client.create_secondary_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 alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_user.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_user.rb deleted file mode 100644 index 13a47099c7dc..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/create_user.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the create_user call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_user. -# -def create_user - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new - - # Call the create_user method. - result = client.create_user request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_backup.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_backup.rb deleted file mode 100644 index b37c9ca0ff30..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_backup.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the delete_backup call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_backup. -# -def delete_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new - - # Call the delete_backup method. - result = client.delete_backup request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_cluster.rb deleted file mode 100644 index f0a18d5b54f2..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the delete_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_cluster. -# -def delete_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new - - # Call the delete_cluster method. - result = client.delete_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_instance.rb deleted file mode 100644 index a82b5b9bc216..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the delete_instance call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_instance. -# -def delete_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new - - # Call the delete_instance method. - result = client.delete_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_user.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_user.rb deleted file mode 100644 index ecd93e4b526b..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/delete_user.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the delete_user call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_user. -# -def delete_user - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new - - # Call the delete_user method. - result = client.delete_user request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/execute_sql.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/execute_sql.rb deleted file mode 100644 index c0df27e85b07..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/execute_sql.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the execute_sql call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#execute_sql. -# -def execute_sql - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new - - # Call the execute_sql method. - result = client.execute_sql request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/export_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/export_cluster.rb deleted file mode 100644 index 61cbc03dd066..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/export_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the export_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#export_cluster. -# -def export_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new - - # Call the export_cluster method. - result = client.export_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/failover_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/failover_instance.rb deleted file mode 100644 index 33e174236516..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/failover_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the failover_instance call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#failover_instance. -# -def failover_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new - - # Call the failover_instance method. - result = client.failover_instance request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/generate_client_certificate.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/generate_client_certificate.rb deleted file mode 100644 index 63105e278149..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/generate_client_certificate.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the generate_client_certificate call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#generate_client_certificate. -# -def generate_client_certificate - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new - - # Call the generate_client_certificate method. - result = client.generate_client_certificate request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_backup.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_backup.rb deleted file mode 100644 index 0c656bbd553d..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_backup.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the get_backup call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_backup. -# -def get_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::GetBackupRequest.new - - # Call the get_backup method. - result = client.get_backup request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::Backup. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_cluster.rb deleted file mode 100644 index 57a2cceb3a40..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_cluster.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the get_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_cluster. -# -def get_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new - - # Call the get_cluster method. - result = client.get_cluster request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::Cluster. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_connection_info.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_connection_info.rb deleted file mode 100644 index 35d7fefaea44..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_connection_info.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the get_connection_info call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_connection_info. -# -def get_connection_info - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new - - # Call the get_connection_info method. - result = client.get_connection_info request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::ConnectionInfo. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_instance.rb deleted file mode 100644 index faf012d1f243..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_instance.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the get_instance call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_instance. -# -def get_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new - - # Call the get_instance method. - result = client.get_instance request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::Instance. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_user.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_user.rb deleted file mode 100644 index dfa487141659..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/get_user.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the get_user call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_user. -# -def get_user - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::GetUserRequest.new - - # Call the get_user method. - result = client.get_user request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/import_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/import_cluster.rb deleted file mode 100644 index f89cca0004be..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/import_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the import_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#import_cluster. -# -def import_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new - - # Call the import_cluster method. - result = client.import_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/inject_fault.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/inject_fault.rb deleted file mode 100644 index b91c8d2344f0..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/inject_fault.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the inject_fault call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#inject_fault. -# -def inject_fault - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new - - # Call the inject_fault method. - result = client.inject_fault request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_backups.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_backups.rb deleted file mode 100644 index 93370f877a95..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_backups.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the list_backups call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_backups. -# -def list_backups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Backup. - p item - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_clusters.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_clusters.rb deleted file mode 100644 index 46132eccd659..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_clusters.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the list_clusters call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_clusters. -# -def list_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::ListClustersRequest.new - - # Call the list_clusters method. - result = client.list_clusters request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::AlloyDB::V1beta::Cluster. - p item - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_databases.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_databases.rb deleted file mode 100644 index c6e8bfd45232..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_databases.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the list_databases call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_databases. -# -def list_databases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Database. - p item - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_instances.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_instances.rb deleted file mode 100644 index a4eb8da5419c..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_instances.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the list_instances call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_instances. -# -def list_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::Instance. - p item - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_supported_database_flags.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_supported_database_flags.rb deleted file mode 100644 index 948612733d08..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_supported_database_flags.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the list_supported_database_flags call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_supported_database_flags. -# -def list_supported_database_flags - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new - - # Call the list_supported_database_flags method. - result = client.list_supported_database_flags request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::AlloyDB::V1beta::SupportedDatabaseFlag. - p item - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_users.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_users.rb deleted file mode 100644 index 3d1cc2222566..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/list_users.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the list_users call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_users. -# -def list_users - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::ListUsersRequest.new - - # Call the list_users method. - result = client.list_users request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::AlloyDB::V1beta::User. - p item - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/promote_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/promote_cluster.rb deleted file mode 100644 index 3bfcce902eaf..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/promote_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the promote_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#promote_cluster. -# -def promote_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new - - # Call the promote_cluster method. - result = client.promote_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restart_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restart_instance.rb deleted file mode 100644 index e6152e02dadc..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restart_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the restart_instance call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restart_instance. -# -def restart_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new - - # Call the restart_instance method. - result = client.restart_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 alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restore_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restore_cluster.rb deleted file mode 100644 index 8c4782f0f0d9..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/restore_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the restore_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restore_cluster. -# -def restore_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new - - # Call the restore_cluster method. - result = client.restore_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/switchover_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/switchover_cluster.rb deleted file mode 100644 index d20ead6d7e68..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/switchover_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the switchover_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#switchover_cluster. -# -def switchover_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new - - # Call the switchover_cluster method. - result = client.switchover_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_backup.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_backup.rb deleted file mode 100644 index 2852a2e5fb86..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_backup.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the update_backup call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_backup. -# -def update_backup - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new - - # Call the update_backup method. - result = client.update_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 alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_cluster.rb deleted file mode 100644 index 7199ebdb1af7..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the update_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_cluster. -# -def update_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new - - # Call the update_cluster method. - result = client.update_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_instance.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_instance.rb deleted file mode 100644 index b1fe3cbba369..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_instance.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the update_instance call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_instance. -# -def update_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::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 alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_user.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_user.rb deleted file mode 100644 index 41d4cd207c59..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/update_user.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the update_user call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_user. -# -def update_user - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new - - # Call the update_user method. - result = client.update_user request - - # The returned object is of type Google::Cloud::AlloyDB::V1beta::User. - p result -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/upgrade_cluster.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/upgrade_cluster.rb deleted file mode 100644 index 49fd373c8882..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_admin/upgrade_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the upgrade_cluster call in the AlloyDBAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#upgrade_cluster. -# -def upgrade_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new - - # Call the upgrade_cluster method. - result = client.upgrade_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb deleted file mode 100644 index 2bad2da7e8ab..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START alloydb_v1beta_generated_AlloyDBCloudSQLAdmin_RestoreFromCloudSQL_sync] -require "google/cloud/alloy_db/v1beta" - -## -# Snippet for the restore_from_cloud_sql call in the AlloyDBCloudSQLAdmin service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client#restore_from_cloud_sql. -# -def restore_from_cloud_sql - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new - - # Call the restore_from_cloud_sql method. - result = client.restore_from_cloud_sql request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END alloydb_v1beta_generated_AlloyDBCloudSQLAdmin_RestoreFromCloudSQL_sync] diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/snippet_metadata_google.cloud.alloydb.v1beta.json b/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/snippet_metadata_google.cloud.alloydb.v1beta.json deleted file mode 100644 index ae3fb3fc03bf..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/snippets/snippet_metadata_google.cloud.alloydb.v1beta.json +++ /dev/null @@ -1,1575 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-alloy_db-v1beta", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.alloydb.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListClusters_sync", - "title": "Snippet for the list_clusters call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_clusters.", - "file": "alloy_db_admin/list_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clusters", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ListClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::ListClustersResponse", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ListClusters", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListClusters", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetCluster_sync", - "title": "Snippet for the get_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_cluster.", - "file": "alloy_db_admin/get_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::GetClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::Cluster", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "GetCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateCluster_sync", - "title": "Snippet for the create_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_cluster.", - "file": "alloy_db_admin/create_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "CreateCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateCluster_sync", - "title": "Snippet for the update_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_cluster.", - "file": "alloy_db_admin/update_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "UpdateCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ExportCluster_sync", - "title": "Snippet for the export_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#export_cluster.", - "file": "alloy_db_admin/export_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#export_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ExportCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExportCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ImportCluster_sync", - "title": "Snippet for the import_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#import_cluster.", - "file": "alloy_db_admin/import_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#import_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ImportCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ImportCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpgradeCluster_sync", - "title": "Snippet for the upgrade_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#upgrade_cluster.", - "file": "alloy_db_admin/upgrade_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "upgrade_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#upgrade_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "UpgradeCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpgradeCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteCluster_sync", - "title": "Snippet for the delete_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_cluster.", - "file": "alloy_db_admin/delete_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "DeleteCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_PromoteCluster_sync", - "title": "Snippet for the promote_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#promote_cluster.", - "file": "alloy_db_admin/promote_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "promote_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#promote_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "PromoteCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.PromoteCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_SwitchoverCluster_sync", - "title": "Snippet for the switchover_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#switchover_cluster.", - "file": "alloy_db_admin/switchover_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "switchover_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#switchover_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "SwitchoverCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.SwitchoverCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_RestoreCluster_sync", - "title": "Snippet for the restore_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restore_cluster.", - "file": "alloy_db_admin/restore_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restore_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "RestoreCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestoreCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryCluster_sync", - "title": "Snippet for the create_secondary_cluster call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_cluster.", - "file": "alloy_db_admin/create_secondary_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_secondary_cluster", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "CreateSecondaryCluster", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryCluster", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListInstances_sync", - "title": "Snippet for the list_instances call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_instances.", - "file": "alloy_db_admin/list_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instances", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::ListInstancesResponse", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ListInstances", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListInstances", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetInstance_sync", - "title": "Snippet for the get_instance call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_instance.", - "file": "alloy_db_admin/get_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::Instance", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "GetInstance", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetInstance", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateInstance_sync", - "title": "Snippet for the create_instance call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_instance.", - "file": "alloy_db_admin/create_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_instance", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "CreateInstance", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateInstance", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateSecondaryInstance_sync", - "title": "Snippet for the create_secondary_instance call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_instance.", - "file": "alloy_db_admin/create_secondary_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_secondary_instance", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_secondary_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "CreateSecondaryInstance", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateSecondaryInstance", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_BatchCreateInstances_sync", - "title": "Snippet for the batch_create_instances call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#batch_create_instances.", - "file": "alloy_db_admin/batch_create_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_instances", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#batch_create_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "BatchCreateInstances", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.BatchCreateInstances", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateInstance_sync", - "title": "Snippet for the update_instance call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_instance.", - "file": "alloy_db_admin/update_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_instance", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "UpdateInstance", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateInstance", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteInstance_sync", - "title": "Snippet for the delete_instance call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_instance.", - "file": "alloy_db_admin/delete_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_instance", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "DeleteInstance", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteInstance", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_FailoverInstance_sync", - "title": "Snippet for the failover_instance call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#failover_instance.", - "file": "alloy_db_admin/failover_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "failover_instance", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#failover_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "FailoverInstance", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.FailoverInstance", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_InjectFault_sync", - "title": "Snippet for the inject_fault call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#inject_fault.", - "file": "alloy_db_admin/inject_fault.rb", - "language": "RUBY", - "client_method": { - "short_name": "inject_fault", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#inject_fault", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "InjectFault", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.InjectFault", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_RestartInstance_sync", - "title": "Snippet for the restart_instance call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restart_instance.", - "file": "alloy_db_admin/restart_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "restart_instance", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#restart_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "RestartInstance", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.RestartInstance", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ExecuteSql_sync", - "title": "Snippet for the execute_sql call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#execute_sql.", - "file": "alloy_db_admin/execute_sql.rb", - "language": "RUBY", - "client_method": { - "short_name": "execute_sql", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#execute_sql", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ExecuteSql", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ExecuteSql", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListBackups_sync", - "title": "Snippet for the list_backups call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_backups.", - "file": "alloy_db_admin/list_backups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_backups", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_backups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::ListBackupsResponse", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ListBackups", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListBackups", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetBackup_sync", - "title": "Snippet for the get_backup call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_backup.", - "file": "alloy_db_admin/get_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_backup", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::GetBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::Backup", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "GetBackup", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetBackup", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateBackup_sync", - "title": "Snippet for the create_backup call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_backup.", - "file": "alloy_db_admin/create_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_backup", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "CreateBackup", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateBackup", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateBackup_sync", - "title": "Snippet for the update_backup call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_backup.", - "file": "alloy_db_admin/update_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_backup", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "UpdateBackup", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateBackup", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteBackup_sync", - "title": "Snippet for the delete_backup call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_backup.", - "file": "alloy_db_admin/delete_backup.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_backup", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_backup", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "DeleteBackup", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteBackup", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListSupportedDatabaseFlags_sync", - "title": "Snippet for the list_supported_database_flags call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_supported_database_flags.", - "file": "alloy_db_admin/list_supported_database_flags.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_supported_database_flags", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_supported_database_flags", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ListSupportedDatabaseFlags", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListSupportedDatabaseFlags", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GenerateClientCertificate_sync", - "title": "Snippet for the generate_client_certificate call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#generate_client_certificate.", - "file": "alloy_db_admin/generate_client_certificate.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_client_certificate", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#generate_client_certificate", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "GenerateClientCertificate", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GenerateClientCertificate", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetConnectionInfo_sync", - "title": "Snippet for the get_connection_info call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_connection_info.", - "file": "alloy_db_admin/get_connection_info.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_connection_info", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_connection_info", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::ConnectionInfo", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "GetConnectionInfo", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetConnectionInfo", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListUsers_sync", - "title": "Snippet for the list_users call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_users.", - "file": "alloy_db_admin/list_users.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_users", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_users", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ListUsersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::ListUsersResponse", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ListUsers", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListUsers", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_GetUser_sync", - "title": "Snippet for the get_user call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_user.", - "file": "alloy_db_admin/get_user.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_user", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#get_user", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::GetUserRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::User", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "GetUser", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.GetUser", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateUser_sync", - "title": "Snippet for the create_user call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_user.", - "file": "alloy_db_admin/create_user.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_user", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_user", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::CreateUserRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::User", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "CreateUser", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateUser", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_UpdateUser_sync", - "title": "Snippet for the update_user call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_user.", - "file": "alloy_db_admin/update_user.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_user", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#update_user", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::User", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "UpdateUser", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.UpdateUser", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_DeleteUser_sync", - "title": "Snippet for the delete_user call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_user.", - "file": "alloy_db_admin/delete_user.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_user", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#delete_user", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "DeleteUser", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.DeleteUser", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_ListDatabases_sync", - "title": "Snippet for the list_databases call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_databases.", - "file": "alloy_db_admin/list_databases.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_databases", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#list_databases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::ListDatabasesResponse", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "ListDatabases", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.ListDatabases", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBAdmin_CreateDatabase_sync", - "title": "Snippet for the create_database call in the AlloyDBAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_database.", - "file": "alloy_db_admin/create_database.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_database", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client#create_database", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::AlloyDB::V1beta::Database", - "client": { - "short_name": "AlloyDBAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client" - }, - "method": { - "short_name": "CreateDatabase", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin.CreateDatabase", - "service": { - "short_name": "AlloyDBAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBAdmin" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "alloydb_v1beta_generated_AlloyDBCloudSQLAdmin_RestoreFromCloudSQL_sync", - "title": "Snippet for the restore_from_cloud_sql call in the AlloyDBCloudSQLAdmin service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client#restore_from_cloud_sql.", - "file": "alloy_db_cloud_sql_admin/restore_from_cloud_sql.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_from_cloud_sql", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client#restore_from_cloud_sql", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AlloyDBCloudSQLAdmin::Client", - "full_name": "::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client" - }, - "method": { - "short_name": "RestoreFromCloudSQL", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin.RestoreFromCloudSQL", - "service": { - "short_name": "AlloyDBCloudSQLAdmin", - "full_name": "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin" - } - } - }, - "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-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb deleted file mode 100644 index 06818ae7bdbc..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/alloydb/v1beta/service_pb" -require "google/cloud/alloydb/v1beta/service_services_pb" -require "google/cloud/alloy_db/v1beta/alloy_db_admin" - -class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb deleted file mode 100644 index 79f3d0c8a4c1..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_paths_test.rb +++ /dev/null @@ -1,163 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/alloy_db/v1beta/alloy_db_admin" - -class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_path project: "value0", location: "value1", backup: "value2" - assert_equal "projects/value0/locations/value1/backups/value2", path - end - end - - def test_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2", path - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.database_path project: "value0", location: "value1", cluster: "value2", database: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/databases/value3", path - end - end - - def test_instance_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_path project: "value0", location: "value1", cluster: "value2", instance: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/instances/value3", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_network_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/global/networks/value1", path - end - end - - def test_service_attachment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_attachment_path project: "value0", region: "value1", service_attachment: "value2" - assert_equal "projects/value0/regions/value1/serviceAttachments/value2", path - end - end - - def test_user_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.user_path project: "value0", location: "value1", cluster: "value2", user: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/users/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb deleted file mode 100644 index 76e43428f0ca..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_rest_test.rb +++ /dev/null @@ -1,2271 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/alloydb/v1beta/service_pb" -require "google/cloud/alloy_db/v1beta/alloy_db_admin/rest" - - -class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_clusters - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::ListClustersResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_clusters parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_clusters ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.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_clusters_client_stub.call_count - end - end - end - - def test_get_cluster - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::Cluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - view = :CLUSTER_VIEW_UNSPECIFIED - - get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster({ name: name, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster name: name, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new(name: name, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster({ name: name, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new(name: name, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_count - end - end - end - - def test_create_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - validate_only = true - - create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_count - end - end - end - - def test_update_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - update_mask = {} - cluster = {} - request_id = "hello world" - validate_only = true - allow_missing = true - - update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_count - end - end - end - - def test_export_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - gcs_destination = {} - csv_export_options = {} - name = "hello world" - database = "hello world" - - export_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_export_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.export_cluster({ gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.export_cluster gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.export_cluster ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new(gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.export_cluster({ gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.export_cluster(::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new(gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_cluster_client_stub.call_count - end - end - end - - def test_import_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - sql_import_options = {} - name = "hello world" - gcs_uri = "hello world" - database = "hello world" - user = "hello world" - - import_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_import_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_cluster({ sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_cluster sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_cluster ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new(sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_cluster({ sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_cluster(::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new(sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_cluster_client_stub.call_count - end - end - end - - def test_upgrade_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - version = :DATABASE_VERSION_UNSPECIFIED - request_id = "hello world" - validate_only = true - etag = "hello world" - - upgrade_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_upgrade_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, upgrade_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.upgrade_cluster({ name: name, version: version, request_id: request_id, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.upgrade_cluster name: name, version: version, request_id: request_id, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.upgrade_cluster ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new(name: name, version: version, request_id: request_id, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.upgrade_cluster({ name: name, version: version, request_id: request_id, 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.upgrade_cluster(::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new(name: name, version: version, request_id: request_id, 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, upgrade_cluster_client_stub.call_count - end - end - end - - def test_delete_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - etag = "hello world" - validate_only = true - force = true - - delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_count - end - end - end - - def test_promote_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - etag = "hello world" - validate_only = true - - promote_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_promote_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, promote_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.promote_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.promote_cluster name: name, request_id: request_id, etag: etag, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.promote_cluster ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.promote_cluster({ name: name, request_id: request_id, 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.promote_cluster(::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new(name: name, request_id: request_id, 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, promote_cluster_client_stub.call_count - end - end - end - - def test_switchover_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - validate_only = true - - switchover_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_switchover_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, switchover_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.switchover_cluster({ name: name, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.switchover_cluster name: name, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.switchover_cluster ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new(name: name, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.switchover_cluster({ name: name, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.switchover_cluster(::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new(name: name, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, switchover_cluster_client_stub.call_count - end - end - end - - def test_restore_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - backup_source = {} - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - validate_only = true - - restore_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_restore_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restore_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.restore_cluster({ backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.restore_cluster backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.restore_cluster ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new(backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.restore_cluster({ backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.restore_cluster(::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new(backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, restore_cluster_client_stub.call_count - end - end - end - - def test_create_secondary_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - validate_only = true - - create_secondary_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_secondary_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_secondary_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_secondary_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_secondary_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_secondary_cluster ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_secondary_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_secondary_cluster(::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_secondary_cluster_client_stub.call_count - end - end - end - - def test_list_instances - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::ListInstancesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_instances_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_instances ::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_instances(::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_instances_client_stub.call_count - end - end - end - - def test_get_instance - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::Instance.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - view = :INSTANCE_VIEW_UNSPECIFIED - - 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance({ name: name, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance name: name, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance ::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new(name: name, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance({ name: name, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new(name: name, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_count - end - end - end - - def test_create_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_id = "hello world" - instance = {} - request_id = "hello world" - validate_only = true - - 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_instance ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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(::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_client_stub.call_count - end - end - end - - def test_create_secondary_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_id = "hello world" - instance = {} - request_id = "hello world" - validate_only = true - - create_secondary_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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_secondary_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_secondary_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_secondary_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_secondary_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_secondary_instance ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_secondary_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_secondary_instance(::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_secondary_instance_client_stub.call_count - end - end - end - - def test_batch_create_instances - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - requests = {} - request_id = "hello world" - - batch_create_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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_batch_create_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_instances_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_create_instances({ parent: parent, requests: requests, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_create_instances parent: parent, requests: requests, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_create_instances ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new(parent: parent, requests: requests, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_create_instances({ parent: parent, requests: requests, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_create_instances(::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new(parent: parent, requests: requests, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_instances_client_stub.call_count - end - end - end - - def test_update_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - update_mask = {} - instance = {} - request_id = "hello world" - validate_only = true - allow_missing = true - - 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_update_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_instance update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_instance ::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_instance(::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), 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::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" - etag = "hello world" - validate_only = true - - 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_delete_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_instance({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_instance name: name, request_id: request_id, etag: etag, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new(name: name, request_id: request_id, 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({ name: name, request_id: request_id, 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(::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new(name: name, request_id: request_id, 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_client_stub.call_count - end - end - end - - def test_failover_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - validate_only = true - - failover_instance_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_failover_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, failover_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.failover_instance({ name: name, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.failover_instance name: name, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.failover_instance ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.failover_instance({ name: name, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.failover_instance(::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, failover_instance_client_stub.call_count - end - end - end - - def test_inject_fault - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - fault_type = :FAULT_TYPE_UNSPECIFIED - name = "hello world" - request_id = "hello world" - validate_only = true - - inject_fault_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_inject_fault_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, inject_fault_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.inject_fault({ fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.inject_fault fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.inject_fault ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new(fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.inject_fault({ fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.inject_fault(::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new(fault_type: fault_type, name: name, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, inject_fault_client_stub.call_count - end - end - end - - def test_restart_instance - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - validate_only = true - node_ids = ["hello world"] - - restart_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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_restart_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restart_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.restart_instance({ name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.restart_instance name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.restart_instance ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.restart_instance({ name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.restart_instance(::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only, node_ids: node_ids), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, restart_instance_client_stub.call_count - end - end - end - - def test_execute_sql - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - password = "hello world" - instance = "hello world" - database = "hello world" - user = "hello world" - sql_statement = "hello world" - validate_only = true - - execute_sql_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_execute_sql_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, execute_sql_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.execute_sql({ password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.execute_sql password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.execute_sql ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new(password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.execute_sql({ password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.execute_sql(::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new(password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, execute_sql_client_stub.call_count - end - end - end - - def test_list_backups - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::ListBackupsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_backups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_backups_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_backups parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_backups ::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest.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_backups({ 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_backups(::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest.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_backups_client_stub.call_count - end - end - end - - def test_get_backup - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_backup_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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_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 = {} - request_id = "hello world" - validate_only = true - - 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_backup_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, validate_only: validate_only }) 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, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_backup ::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, validate_only: validate_only) 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, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_backup(::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, validate_only: validate_only), 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_update_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. - update_mask = {} - backup = {} - request_id = "hello world" - validate_only = true - allow_missing = true - - 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_update_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_backup_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_backup update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_backup ::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_backup(::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), 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::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" - validate_only = true - etag = "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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_delete_backup_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_backup({ name: name, request_id: request_id, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_backup name: name, request_id: request_id, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_backup({ name: name, request_id: request_id, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_count - end - end - end - - def test_list_supported_database_flags - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - scope = :SCOPE_UNSPECIFIED - - list_supported_database_flags_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_supported_database_flags_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_supported_database_flags_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_supported_database_flags({ parent: parent, page_size: page_size, page_token: page_token, scope: scope }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_supported_database_flags parent: parent, page_size: page_size, page_token: page_token, scope: scope do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_supported_database_flags ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new(parent: parent, page_size: page_size, page_token: page_token, scope: scope) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_supported_database_flags({ parent: parent, page_size: page_size, page_token: page_token, scope: scope }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_supported_database_flags(::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new(parent: parent, page_size: page_size, page_token: page_token, scope: scope), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_supported_database_flags_client_stub.call_count - end - end - end - - def test_generate_client_certificate - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - request_id = "hello world" - pem_csr = "hello world" - cert_duration = {} - public_key = "hello world" - use_metadata_exchange = true - - generate_client_certificate_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_generate_client_certificate_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_client_certificate_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_client_certificate({ parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_client_certificate parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_client_certificate ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new(parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_client_certificate({ parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_client_certificate(::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new(parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_client_certificate_client_stub.call_count - end - end - end - - def test_get_connection_info - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::ConnectionInfo.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - request_id = "hello world" - - get_connection_info_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_connection_info_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_connection_info_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_connection_info({ parent: parent, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_connection_info parent: parent, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_connection_info ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new(parent: parent, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_connection_info({ parent: parent, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_connection_info(::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new(parent: parent, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_connection_info_client_stub.call_count - end - end - end - - def test_list_users - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::ListUsersResponse.new - http_response = OpenStruct.new 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_users_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_users_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_users_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_users({ parent: parent, page_size: 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_users parent: parent, page_size: 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_users ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest.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_users({ 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_users(::Google::Cloud::AlloyDB::V1beta::ListUsersRequest.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_users_client_stub.call_count - end - end - end - - def test_get_user - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::User.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_get_user_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_user_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_user({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_user name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_user ::Google::Cloud::AlloyDB::V1beta::GetUserRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_user({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_user(::Google::Cloud::AlloyDB::V1beta::GetUserRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_user_client_stub.call_count - end - end - end - - def test_create_user - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::User.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - user_id = "hello world" - user = {} - request_id = "hello world" - validate_only = true - - create_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_user_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_user_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_user({ parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_user parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_user ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new(parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_user({ parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_user(::Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new(parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_user_client_stub.call_count - end - end - end - - def test_update_user - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::User.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - update_mask = {} - user = {} - request_id = "hello world" - validate_only = true - allow_missing = true - - update_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_update_user_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_user_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_user({ update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_user update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_user ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new(update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_user({ update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_user(::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new(update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_user_client_stub.call_count - end - end - end - - def test_delete_user - # 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" - validate_only = true - - delete_user_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_delete_user_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_user_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_user({ name: name, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_user name: name, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_user ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new(name: name, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_user({ name: name, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_user(::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new(name: name, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_user_client_stub.call_count - end - end - end - - def test_list_databases - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::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" - filter = "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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_list_databases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_databases_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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, filter: filter }) 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, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_databases ::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest.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_databases({ 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_databases(::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest.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_databases_client_stub.call_count - end - end - end - - def test_create_database - # Create test objects. - client_result = ::Google::Cloud::AlloyDB::V1beta::Database.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" - database = {} - - 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::AlloyDB::V1beta::AlloyDBAdmin::Rest::ServiceStub.stub :transcode_create_database_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_database_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_database({ parent: parent, database_id: database_id, database: database }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_database parent: parent, database_id: database_id, database: database do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_database ::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new(parent: parent, database_id: database_id, database: database) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_database({ parent: parent, database_id: database_id, database: database }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_database(::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new(parent: parent, database_id: database_id, database: database), 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_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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb deleted file mode 100644 index e98c748e6747..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_admin_test.rb +++ /dev/null @@ -1,2702 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/alloydb/v1beta/service_pb" -require "google/cloud/alloy_db/v1beta/alloy_db_admin" - -class ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListClustersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clusters, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest, 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_clusters_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clusters({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_clusters parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_clusters ::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::AlloyDB::V1beta::ListClustersRequest.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_clusters_client_stub.call_rpc_count - end - end - - def test_get_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::Cluster.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - view = :CLUSTER_VIEW_UNSPECIFIED - - get_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal :CLUSTER_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new(name: name, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster({ name: name, 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_cluster(::Google::Cloud::AlloyDB::V1beta::GetClusterRequest.new(name: name, 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_cluster_client_stub.call_rpc_count - end - end - - def test_create_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - validate_only = true - - create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster ::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster(::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_cluster_client_stub.call_rpc_count - end - end - - def test_update_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - update_mask = {} - cluster = {} - request_id = "hello world" - validate_only = true - allow_missing = true - - update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::AlloyDB::V1beta::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_rpc_count - end - end - - def test_export_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - gcs_destination = {} - csv_export_options = {} - name = "hello world" - database = "hello world" - - export_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::GcsDestination), request["gcs_destination"] - assert_equal :gcs_destination, request.destination - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest::CsvExportOptions), request["csv_export_options"] - assert_equal :csv_export_options, request.export_options - assert_equal "hello world", request["name"] - assert_equal "hello world", request["database"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.export_cluster({ gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.export_cluster gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.export_cluster ::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new(gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.export_cluster({ gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.export_cluster(::Google::Cloud::AlloyDB::V1beta::ExportClusterRequest.new(gcs_destination: gcs_destination, csv_export_options: csv_export_options, name: name, database: database), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, export_cluster_client_stub.call_rpc_count - end - end - - def test_import_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - sql_import_options = {} - name = "hello world" - gcs_uri = "hello world" - database = "hello world" - user = "hello world" - - import_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest::SqlImportOptions), request["sql_import_options"] - assert_equal :sql_import_options, request.import_options - assert_equal "hello world", request["name"] - assert_equal "hello world", request["gcs_uri"] - assert_equal "hello world", request["database"] - assert_equal "hello world", request["user"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_cluster({ sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.import_cluster sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.import_cluster ::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new(sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.import_cluster({ sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.import_cluster(::Google::Cloud::AlloyDB::V1beta::ImportClusterRequest.new(sql_import_options: sql_import_options, name: name, gcs_uri: gcs_uri, database: database, user: user), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, import_cluster_client_stub.call_rpc_count - end - end - - def test_upgrade_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - version = :DATABASE_VERSION_UNSPECIFIED - request_id = "hello world" - validate_only = true - etag = "hello world" - - upgrade_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :upgrade_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal :DATABASE_VERSION_UNSPECIFIED, request["version"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, upgrade_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.upgrade_cluster({ name: name, version: version, request_id: request_id, 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.upgrade_cluster name: name, version: version, request_id: request_id, 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.upgrade_cluster ::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new(name: name, version: version, request_id: request_id, 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.upgrade_cluster({ name: name, version: version, request_id: request_id, 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.upgrade_cluster(::Google::Cloud::AlloyDB::V1beta::UpgradeClusterRequest.new(name: name, version: version, request_id: request_id, 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, upgrade_cluster_client_stub.call_rpc_count - end - end - - def test_delete_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - etag = "hello world" - validate_only = true - force = true - - delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::AlloyDB::V1beta::DeleteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only, force: force), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_rpc_count - end - end - - def test_promote_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - etag = "hello world" - validate_only = true - - promote_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :promote_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, promote_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.promote_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.promote_cluster name: name, request_id: request_id, etag: etag, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.promote_cluster ::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.promote_cluster({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.promote_cluster(::Google::Cloud::AlloyDB::V1beta::PromoteClusterRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, promote_cluster_client_stub.call_rpc_count - end - end - - def test_switchover_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - validate_only = true - - switchover_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :switchover_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, switchover_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.switchover_cluster({ name: name, request_id: request_id, 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.switchover_cluster name: name, request_id: request_id, 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.switchover_cluster ::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new(name: name, request_id: request_id, 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.switchover_cluster({ name: name, request_id: request_id, 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.switchover_cluster(::Google::Cloud::AlloyDB::V1beta::SwitchoverClusterRequest.new(name: name, request_id: request_id, 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, switchover_cluster_client_stub.call_rpc_count - end - end - - def test_restore_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - backup_source = {} - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - validate_only = true - - restore_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :restore_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::BackupSource), request["backup_source"] - assert_equal :backup_source, request.source - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, restore_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.restore_cluster({ backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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.restore_cluster backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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.restore_cluster ::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new(backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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.restore_cluster({ backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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.restore_cluster(::Google::Cloud::AlloyDB::V1beta::RestoreClusterRequest.new(backup_source: backup_source, parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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, restore_cluster_client_stub.call_rpc_count - end - end - - def test_create_secondary_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - validate_only = true - - create_secondary_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_secondary_cluster, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_secondary_cluster_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_secondary_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster(::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, 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_secondary_cluster_client_stub.call_rpc_count - end - end - - def test_list_instances - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListInstancesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instances, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_instances parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_instances ::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_instances({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_instances(::Google::Cloud::AlloyDB::V1beta::ListInstancesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_instances_client_stub.call_rpc_count - end - end - - def test_get_instance - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::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" - view = :INSTANCE_VIEW_UNSPECIFIED - - get_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal :INSTANCE_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance ::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new(name: name, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_instance({ name: name, 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_instance(::Google::Cloud::AlloyDB::V1beta::GetInstanceRequest.new(name: name, 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_instance_client_stub.call_rpc_count - end - end - - def test_create_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_id = "hello world" - instance = {} - request_id = "hello world" - validate_only = true - - create_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_instance, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Instance), request["instance"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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 parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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 ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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(::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_client_stub.call_rpc_count - end - end - - def test_create_secondary_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - instance_id = "hello world" - instance = {} - request_id = "hello world" - validate_only = true - - create_secondary_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_secondary_instance, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["instance_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Instance), request["instance"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_secondary_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_secondary_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance ::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance({ parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance(::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new(parent: parent, instance_id: instance_id, instance: instance, request_id: request_id, 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_secondary_instance_client_stub.call_rpc_count - end - end - - def test_batch_create_instances - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - requests = {} - request_id = "hello world" - - batch_create_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_instances, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests), request["requests"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_instances_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_create_instances({ parent: parent, requests: requests, request_id: request_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.batch_create_instances parent: parent, requests: requests, request_id: request_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.batch_create_instances ::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new(parent: parent, requests: requests, request_id: request_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.batch_create_instances({ parent: parent, requests: requests, 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.batch_create_instances(::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new(parent: parent, requests: requests, 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, batch_create_instances_client_stub.call_rpc_count - end - end - - def test_update_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - update_mask = {} - instance = {} - request_id = "hello world" - validate_only = true - allow_missing = true - - update_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_instance, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Instance), request["instance"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_instance update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_instance ::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_instance({ update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_instance(::Google::Cloud::AlloyDB::V1beta::UpdateInstanceRequest.new(update_mask: update_mask, instance: instance, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_instance_client_stub.call_rpc_count - end - end - - def test_delete_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - etag = "hello world" - validate_only = true - - delete_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_instance, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_instance({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_instance name: name, request_id: request_id, etag: etag, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_instance ::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_instance({ name: name, request_id: request_id, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_instance(::Google::Cloud::AlloyDB::V1beta::DeleteInstanceRequest.new(name: name, request_id: request_id, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_instance_client_stub.call_rpc_count - end - end - - def test_failover_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - validate_only = true - - failover_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :failover_instance, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, failover_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.failover_instance({ name: name, request_id: request_id, 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.failover_instance name: name, request_id: request_id, 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.failover_instance ::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new(name: name, request_id: request_id, 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.failover_instance({ name: name, request_id: request_id, 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.failover_instance(::Google::Cloud::AlloyDB::V1beta::FailoverInstanceRequest.new(name: name, request_id: request_id, 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, failover_instance_client_stub.call_rpc_count - end - end - - def test_inject_fault - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - fault_type = :FAULT_TYPE_UNSPECIFIED - name = "hello world" - request_id = "hello world" - validate_only = true - - inject_fault_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :inject_fault, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest, request - assert_equal :FAULT_TYPE_UNSPECIFIED, request["fault_type"] - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, inject_fault_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.inject_fault({ fault_type: fault_type, name: name, request_id: request_id, 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.inject_fault fault_type: fault_type, name: name, request_id: request_id, 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.inject_fault ::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new(fault_type: fault_type, name: name, request_id: request_id, 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.inject_fault({ fault_type: fault_type, name: name, request_id: request_id, 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.inject_fault(::Google::Cloud::AlloyDB::V1beta::InjectFaultRequest.new(fault_type: fault_type, name: name, request_id: request_id, 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, inject_fault_client_stub.call_rpc_count - end - end - - def test_restart_instance - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - validate_only = true - node_ids = ["hello world"] - - restart_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :restart_instance, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - assert_equal ["hello world"], request["node_ids"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, restart_instance_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.restart_instance({ name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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.restart_instance name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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.restart_instance ::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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.restart_instance({ name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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.restart_instance(::Google::Cloud::AlloyDB::V1beta::RestartInstanceRequest.new(name: name, request_id: request_id, validate_only: validate_only, node_ids: node_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, restart_instance_client_stub.call_rpc_count - end - end - - def test_execute_sql - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - password = "hello world" - instance = "hello world" - database = "hello world" - user = "hello world" - sql_statement = "hello world" - validate_only = true - - execute_sql_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :execute_sql, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest, request - assert_equal "hello world", request["password"] - assert_equal :password, request.user_credential - assert_equal "hello world", request["instance"] - assert_equal "hello world", request["database"] - assert_equal "hello world", request["user"] - assert_equal "hello world", request["sql_statement"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, execute_sql_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.execute_sql({ password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.execute_sql password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.execute_sql ::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new(password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.execute_sql({ password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, 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.execute_sql(::Google::Cloud::AlloyDB::V1beta::ExecuteSqlRequest.new(password: password, instance: instance, database: database, user: user, sql_statement: sql_statement, 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, execute_sql_client_stub.call_rpc_count - end - end - - def test_list_backups - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListBackupsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "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::AlloyDB::V1beta::ListBackupsRequest, 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_backups_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_backups({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_backups parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_backups ::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest.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_backups({ 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_backups(::Google::Cloud::AlloyDB::V1beta::ListBackupsRequest.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_backups_client_stub.call_rpc_count - end - end - - def test_get_backup - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::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::AlloyDB::V1beta::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::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::AlloyDB::V1beta::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_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 = {} - request_id = "hello world" - validate_only = true - - create_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_backup, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["backup_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Backup), request["backup"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_backup_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_backup({ parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup ::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup({ parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup(::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new(parent: parent, backup_id: backup_id, backup: backup, request_id: request_id, 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_backup_client_stub.call_rpc_count - end - end - - def test_update_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. - update_mask = {} - backup = {} - request_id = "hello world" - validate_only = true - allow_missing = true - - update_backup_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_backup, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Backup), request["backup"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_backup_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_backup update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_backup ::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_backup({ update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_backup(::Google::Cloud::AlloyDB::V1beta::UpdateBackupRequest.new(update_mask: update_mask, backup: backup, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_backup_client_stub.call_rpc_count - end - end - - def test_delete_backup - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - validate_only = true - etag = "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::AlloyDB::V1beta::DeleteBackupRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_backup_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_backup({ name: name, request_id: request_id, validate_only: validate_only, etag: etag }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_backup name: name, request_id: request_id, validate_only: validate_only, etag: etag do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_backup ::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id, validate_only: validate_only, etag: etag) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_backup({ name: name, request_id: request_id, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_backup(::Google::Cloud::AlloyDB::V1beta::DeleteBackupRequest.new(name: name, request_id: request_id, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_backup_client_stub.call_rpc_count - end - end - - def test_list_supported_database_flags - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - scope = :SCOPE_UNSPECIFIED - - list_supported_database_flags_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_supported_database_flags, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal :SCOPE_UNSPECIFIED, request["scope"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_supported_database_flags_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_supported_database_flags({ parent: parent, page_size: page_size, page_token: page_token, scope: scope }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_supported_database_flags parent: parent, page_size: page_size, page_token: page_token, scope: scope do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_supported_database_flags ::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new(parent: parent, page_size: page_size, page_token: page_token, scope: scope) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_supported_database_flags({ parent: parent, page_size: page_size, page_token: page_token, scope: scope }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_supported_database_flags(::Google::Cloud::AlloyDB::V1beta::ListSupportedDatabaseFlagsRequest.new(parent: parent, page_size: page_size, page_token: page_token, scope: scope), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_supported_database_flags_client_stub.call_rpc_count - end - end - - def test_generate_client_certificate - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - request_id = "hello world" - pem_csr = "hello world" - cert_duration = {} - public_key = "hello world" - use_metadata_exchange = true - - generate_client_certificate_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_client_certificate, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["request_id"] - assert_equal "hello world", request["pem_csr"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["cert_duration"] - assert_equal "hello world", request["public_key"] - assert_equal true, request["use_metadata_exchange"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_client_certificate_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_client_certificate({ parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_client_certificate parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_client_certificate ::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new(parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_client_certificate({ parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_client_certificate(::Google::Cloud::AlloyDB::V1beta::GenerateClientCertificateRequest.new(parent: parent, request_id: request_id, pem_csr: pem_csr, cert_duration: cert_duration, public_key: public_key, use_metadata_exchange: use_metadata_exchange), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_client_certificate_client_stub.call_rpc_count - end - end - - def test_get_connection_info - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::ConnectionInfo.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - request_id = "hello world" - - get_connection_info_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_connection_info, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_connection_info_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_connection_info({ parent: parent, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_connection_info parent: parent, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_connection_info ::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new(parent: parent, 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_connection_info({ parent: parent, 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_connection_info(::Google::Cloud::AlloyDB::V1beta::GetConnectionInfoRequest.new(parent: parent, 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_connection_info_client_stub.call_rpc_count - end - end - - def test_list_users - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::ListUsersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", 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_users_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_users, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest, 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_users_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_users({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_users parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: 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_users ::Google::Cloud::AlloyDB::V1beta::ListUsersRequest.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_users({ 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_users(::Google::Cloud::AlloyDB::V1beta::ListUsersRequest.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_users_client_stub.call_rpc_count - end - end - - def test_get_user - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::User.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_user, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::GetUserRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_user_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_user({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_user name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_user ::Google::Cloud::AlloyDB::V1beta::GetUserRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_user({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_user(::Google::Cloud::AlloyDB::V1beta::GetUserRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_user_client_stub.call_rpc_count - end - end - - def test_create_user - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::User.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - user_id = "hello world" - user = {} - request_id = "hello world" - validate_only = true - - create_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_user, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["user_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::User), request["user"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_user_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_user({ parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_user parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_user ::Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new(parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_user({ parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_user(::Google::Cloud::AlloyDB::V1beta::CreateUserRequest.new(parent: parent, user_id: user_id, user: user, request_id: request_id, validate_only: validate_only), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_user_client_stub.call_rpc_count - end - end - - def test_update_user - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::User.new - grpc_operation = GRPC::ActiveCall::Operation.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 = {} - user = {} - request_id = "hello world" - validate_only = true - allow_missing = true - - update_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_user, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::User), request["user"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_user_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_user({ update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_user update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_user ::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new(update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_user({ update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_user(::Google::Cloud::AlloyDB::V1beta::UpdateUserRequest.new(update_mask: update_mask, user: user, request_id: request_id, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_user_client_stub.call_rpc_count - end - end - - def test_delete_user - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_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" - validate_only = true - - delete_user_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_user, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_user_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_user({ name: name, request_id: request_id, validate_only: validate_only }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_user name: name, request_id: request_id, validate_only: validate_only do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_user ::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new(name: name, request_id: request_id, 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_user({ name: name, request_id: request_id, 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_user(::Google::Cloud::AlloyDB::V1beta::DeleteUserRequest.new(name: name, request_id: request_id, 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_user_client_stub.call_rpc_count - end - end - - def test_list_databases - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::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" - filter = "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::AlloyDB::V1beta::ListDatabasesRequest, 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_databases_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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, 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_databases 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_databases ::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest.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_databases({ 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_databases(::Google::Cloud::AlloyDB::V1beta::ListDatabasesRequest.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_databases_client_stub.call_rpc_count - end - end - - def test_create_database - # Create GRPC objects. - grpc_response = ::Google::Cloud::AlloyDB::V1beta::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. - parent = "hello world" - database_id = "hello world" - database = {} - - create_database_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_database, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["database_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Database), request["database"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_database_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_database({ parent: parent, database_id: database_id, database: database }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_database parent: parent, database_id: database_id, database: database do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_database ::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new(parent: parent, database_id: database_id, database: database) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_database({ parent: parent, database_id: database_id, database: database }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_database(::Google::Cloud::AlloyDB::V1beta::CreateDatabaseRequest.new(parent: parent, database_id: database_id, database: database), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_database_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::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::AlloyDB::V1beta::AlloyDBAdmin::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_operations_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_operations_test.rb deleted file mode 100644 index 4c9456854b1e..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/alloydb/v1beta/csql_service_pb" -require "google/cloud/alloydb/v1beta/csql_service_services_pb" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" - -class ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_paths_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_paths_test.rb deleted file mode 100644 index e7b970af88a0..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_paths_test.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" - -class ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.backup_path project: "value0", location: "value1", backup: "value2" - assert_equal "projects/value0/locations/value1/backups/value2", path - end - end - - def test_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2", path - end - end - - def test_crypto_key_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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_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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_network_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/global/networks/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_rest_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_rest_test.rb deleted file mode 100644 index 12151996a935..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_rest_test.rb +++ /dev/null @@ -1,156 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/alloydb/v1beta/csql_service_pb" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin/rest" - - -class ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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_restore_from_cloud_sql - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - cloudsql_backup_run_source = {} - parent = "hello world" - cluster_id = "hello world" - cluster = {} - - restore_from_cloud_sql_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::ServiceStub.stub :transcode_restore_from_cloud_sql_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restore_from_cloud_sql_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.restore_from_cloud_sql({ cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.restore_from_cloud_sql cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.restore_from_cloud_sql ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new(cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.restore_from_cloud_sql({ cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.restore_from_cloud_sql(::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new(cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, restore_from_cloud_sql_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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_test.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_test.rb deleted file mode 100644 index 26872d3f8985..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin_test.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/alloydb/v1beta/csql_service_pb" -require "google/cloud/alloy_db/v1beta/alloy_db_cloud_sql_admin" - -class ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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_restore_from_cloud_sql - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - cloudsql_backup_run_source = {} - parent = "hello world" - cluster_id = "hello world" - cluster = {} - - restore_from_cloud_sql_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :restore_from_cloud_sql, name - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::CloudSQLBackupRunSource), request["cloudsql_backup_run_source"] - assert_equal :cloudsql_backup_run_source, request.source - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AlloyDB::V1beta::Cluster), request["cluster"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, restore_from_cloud_sql_client_stub do - # Create client - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.restore_from_cloud_sql({ cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster }) do |response, 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_from_cloud_sql cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster do |response, 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_from_cloud_sql ::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new(cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster) do |response, operation| - assert_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_from_cloud_sql({ cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster }, grpc_options) do |response, operation| - assert_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_from_cloud_sql(::Google::Cloud::AlloyDB::V1beta::RestoreFromCloudSQLRequest.new(cloudsql_backup_run_source: cloudsql_backup_run_source, parent: parent, cluster_id: cluster_id, cluster: cluster), grpc_options) do |response, operation| - assert_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_from_cloud_sql_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::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::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::AlloyDB::V1beta::AlloyDBCloudSQLAdmin::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-alloy_db-v1beta/test/helper.rb deleted file mode 100644 index 968201e8049d..000000000000 --- a/owl-bot-staging/google-cloud-alloy_db-v1beta/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"